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: Environment Variables in #include statement???
Topic Summary:
Created On: 16-Aug-2007 18:10
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 Douglas Zawacki, on Thursday, August 16, 2007 7:36 PM

Answer:

Scott,

If you can move the file to a folder under the lib\dxl folder of the $DOORSHOME

Performing a relative include from \Program Files\Telelogic\DOORS_8.1\lib\dxl 
should be one way of resolving your issue.

If you place your DXL files in the folder \Program Files\Telelogic\DOORS_8.1\lib\dxl\mydxl
then your include statement would be

 16-Aug-2007 18:10
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

Just curious is there a way to use $DOORSHOME in a #include statement.  I need to include a file installed in the DOORS home directory, but in some cases the IT in their infinite wisdom decided to install the DOORS client on the C: drive while in others they installed on the D: drive.  Because the include statements are preprocessed an if statement doesn't seem to work.



-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 16-Aug-2007 19:31
User is offline View Users Profile Print this message


Douglas Zawacki

Posts: 58
Joined: 17-Oct-2006

Answer Answer

Scott,

If you can move the file to a folder under the lib\dxl folder of the $DOORSHOME

Performing a relative include from \Program Files\Telelogic\DOORS_8.1\lib\dxl 
should be one way of resolving your issue.

If you place your DXL files in the folder \Program Files\Telelogic\DOORS_8.1\lib\dxl\mydxl
then your include statement would be



Edited: 16-Aug-2007 at 19:37 by Douglas Zawacki
Report this to a Moderator Report this to a Moderator
 16-Aug-2007 19:37
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

duh!!!!  I was putting a back slash in front of mydxl.....

#include <\mydxl\myfile.dxl>

No wonder it didn't work for me.....

Thanks

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 16-Aug-2007 19:37
User is offline View Users Profile Print this message


Chris Jones

Posts: 177
Joined: 1-Jul-2005

There are a few other posts about this same topic....short answer is, "No." Like you say, #includes are preprocessed so you can't conditionalize them (there's unfortunately no #ifdef or anything).

But, the long answer is, "Maybe." One thing you might be able to do is to just make an if/else with two different includes. The code ends up all being there from both includes, but only one ever gets executed. Kind of messy though.

Chris

Edit: Oops, too slow. Didn't quite read your initial post that closely either I see...

Edited: 16-Aug-2007 at 19:39 by Chris Jones
Report this to a Moderator Report this to a Moderator
 16-Aug-2007 19:43
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

quote:

Originally posted by: Chris Jones
There are a few other posts about this same topic....short answer is, "No." Like you say, #includes are preprocessed so you can't conditionalize them (there's unfortunately no #ifdef or anything). But, the long answer is, "Maybe." One thing you might be able to do is to just make an if/else with two different includes. The code ends up all being there from both includes, but only one ever gets executed. Kind of messy though. Chris Edit: Oops, too slow. Didn't quite read your initial post that closely either I see...


Tried that but it didn't work.  Reason is because for one of the includes the file doesn't exist.....

I tried this, but it still tries to include both files:

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 17-Aug-2007 09:56
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

The problem was this. We had existing modules created by the Artisan DOORS synchroniser (ADS), but we did not necessarily have ADS installed on the clients. This caused run time errors whenever the modules were opened.

The solution was to create stub functions and install these, but if ADS was installed then we wanted to use the actual code.

So, we check for the existance of a file and then #include it via an evalTop_ call.

Note that this only works in the top context, i.e. the included file is globally available.

The following is some code from out startup.dxl.

-------------------------
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 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.