Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Layout DXL newbie
Topic Summary:
Created On: 7-Sep-2006 15:31
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 7-Sep-2006 15:31
User is offline View Users Profile Print this message


Al Lione

Posts: 59
Joined: 13-Jul-2004

I am new to Layout DXL, and I am modifying some code that I inherited (naturally, the author doesn't work here anymore...)

The code selectes a function from an include file and uses this in the dxl() call.
My modification includes sending a bool parameter into the the function. I have added this parameter to the function in the include file, and also to the call statement. The errors tell me I have the incorrect number of paramaters and that the bool variable is not declared. I did a quick check by calling the function directly, and it works fine. When I attempt to use it in the dxl() call, it crashes with the above errors. I did properties on the dxl column in my current module to verify that it is running the correct subroutine. I can't post the code because it is company proprietary. Perhaps I am overlooking something simple....

Al
Report this to a Moderator Report this to a Moderator
 7-Sep-2006 17:29
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Some things to check:

Make sure you are picking up the correct include file.
To do this, add a new function with an unlikely name to the included file.
Add a call to this in your layout DXL.
If you get an undefined identifier error, then you are picking up the include file from somewhere else.

Is the function you are calling overloaded, i.e. is there a version with no parameters?
If so, make sure the version with no parameters is declared AFTER the one with some parameters.
In DXL you cannot overload a void function.

e.g.

// will NOT work
void hello()
void hello(bool nicely)

// will work
void hello(bool nicely)
void hell()

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 8-Sep-2006 16:40
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Forgive ignorance; the code you inherited creates a suitable layout dxl column (via call to dxl(col, code))or is it the layout code itself?

I've had no luck with included files in Layouts: it requires all users of the view to have access to the same include files, presumably on the network. I gave up and just copied the relevant functions from the library into the layout itself.

- Louie
Report this to a Moderator Report this to a Moderator
 12-Sep-2006 20:54
User is offline View Users Profile Print this message


Al Lione

Posts: 59
Joined: 13-Jul-2004

The dxl call takes a string which is the path and filename of the include file, followed by the function call and the "obj" parameter. Like this: dxl_string = "<#includepath>\nfunction_call(obj)" dxl(c, dxl_string) I was trying to pass an additional parameter to the function, (obj, testbool) which apparently is a no-no.
Report this to a Moderator Report this to a Moderator
 12-Sep-2006 22:19
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

That snippette will create a column and insert DXL therein. The included reference isn't going to work unless all folks who use the view have access to the network location where exists the include file. Using an include file may be tempting if you figure to update the include file later to make the layout work better, without having to update all the views that house the layout. I've had trouble with that since I'm not sure when the include file gets read; I've certainly updated include files and not seen the results in the layout.

If your include reference is relative (meaning it doesn't start with "c:\" but rather like "MyIncludes\file.inc", then its difficult to predict which include file will actually get included. In this case, if folder "MyIncludes" exists in more than one location where include files are found ([1] default install directory lib\dxl\addins; [2] values of "addins" parameter; [3] current Windows working directory) then you may end up editing an include file that isn't actually being included.

Anyway, you'll have to create a function in the include file that has two paramaters, one that responds to values of testbool. Then the call with two parameters should work.

Forget all that include file stuff. Hard code the code and insert it into the column; may look like this:
// --- start DXL (edited and fixed) -----
Column c = column 2
string dxl_string =
"void function_call(Object obj, bool testbool) { display (identifier(obj)) \"\\tIn Layout\\tTestbool = \" testbool \"\"
}
function_call(obj, true)
" // **** end dxl_string ****

dxl(c, dxl_string)
// --- end DXL ---
then save the view.

- Louie

Edited: 13-Sep-2006 at 15:07 by Louie Landale
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.