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: Selective include statements
Topic Summary:
Created On: 26-Feb-2005 00:04
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.
Answer This question was answered by , on Friday, March 11, 2005 4:49 PM

Answer:
Oh well it seemed to work.
So knowledge spreads and grows.
 26-Feb-2005 00:04
User is offline View Users Profile Print this message


David Jonsson

Posts: 2
Joined: 16-Jul-2003

Has anyone figured out a way to do selective includes with dxl?

I have tried using preprocessor if statements only to get dxl errors (badly formed token #if):

#if (condition){
#include
} #elif (condition) {
#include
}
Report this to a Moderator Report this to a Moderator
 28-Feb-2005 12:57
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Louie put me right on this one a while back.
You cannot have truly conditional includes in DXL.
The example seems to work if the *.inc files are self contained, but don't be fooled.

Any declarations made inside will not be visible outside of the scope of the if statement. Also both files are actually included, so there is no advantage over including the whole lot and using a normal if statement to select different behaviour.



-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 28-Feb-2005 21:58
User is offline View Users Profile Print this message


Bruce Tuskey

Posts: 77
Joined: 2-Mar-2004

The DOORS Preprocessor will read both includes and show errors if something is amiss in any include file. For example, if one include is looking for DOORS Analyst information but he user does not have Analyst installed, you will get DXL errors. This is a real problem for mixed engineering environments. Not all users will have or need Analyst installed. What is needed is a true preprocessor if (#if in c++). I have not found a way yet in DOORS.



-------------------------
Bruce Tuskey
Sr. Principle Engineer
Tuskey@gmail.com

"All that is gold does not glitter, not all those who wander are lost:..." - Gandalf the Grey (JRR Tolkien)

Edited: 28-Feb-2005 at 22:01 by Bruce Tuskey
Report this to a Moderator Report this to a Moderator
 2-Mar-2005 16:44
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

You can "build" your DXL dynamically and then run it in a different context.

By this I mean assemble the DXL, during which you can conditionally include files, and then call eval_ on the resulting string. The dxl must be completely self contained as it is run in a separate context.

See example one.

Similarly, I have used dynamically constructed DXL for layout DXL columns.

See example two.




-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.