![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Use of #include Topic Summary: using string variables with #include Created On: 15-Mar-2006 16:17 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Paul You've confirmed my suspicions - I was hoping there might be a way of declaring 'special' variables before the preprocessing happens ie.. which can be used at that point... Thanks Reik Some useful tips. Thank you. Regards Peter | |
![]() |
|
I'm trying to reduce size of my code by breaking it down into .inc files.
But the path of my dxl files is likely to change, so I want to set up a string variable, and then use that to reference my include my files. But how do I do it?... The following example shows the problem I face string strInclude = "c:/includeMe.inc" //#include strInclude // I want to use this line, but it doesn't work #include "c:/includeMe.inc" // I'm forced to use this line |
|
![]() |
|
![]() |
|
Hi Peter,
AFAIK it is not possible to use dynamic #include statements. I tried this a long time ago to prevent from double including. Btw. you have to assure yourself the dependencies of include files, because there is no #ifndef available! But you can use a different method to define this path. The DOORSADDINS environment variable or the start parameter -a to your doors.exe There you can define a list of search pathes for your include files. These pathes can also refer to mapped network drives, if you neeed this. We are using this method to work directly on our CVS Clearcase. But remember the original path DOORSHOME/lib/dxl/addins will be used as first choice, so if the file you want to include exists in both directories, Doors will use the local one in DOORSHOME/lib/dxl/addins! I hope this will help you a little bit ... Greetings Reik Schröder ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
I think the short answer is you can't do it that way. The problem is that, like C, the proprocessing happens first. This means all includes are done before any code is evaluated. So the variable is undefined when you try to do the include.
Reik has given alternatives (he replied at the same time as me!) ------------------------- Paul dot Tiplady at TRW dot com TRW Automotive |
|
![]() |
|
![]() |
|
Paul
You've confirmed my suspicions - I was hoping there might be a way of declaring 'special' variables before the preprocessing happens ie.. which can be used at that point... Thanks Reik Some useful tips. Thank you. Regards Peter |
|
![]() |
|
![]() |
|
------------------------- Regards, Shyam |
|
![]() |
|
![]() |
|
Yes. Be advised that the addins and DOORSADDINS variables have double use; first to define folders that house menus for open formal modules and also as you said to define where to look for include files.
All my include statements look like this: #include <Includes/BlaBlaBla.inc> My addins points to //Server/DXL/Module. Under that are sibling folders 'Includes' and 'Module-Scripts'; where 'Module-Scripts' appear in the menu (Includes doesn't appear since it does NOT contain any files named 'Includes.hlp' and 'Includes.idx'.). Fine. I have on my local client: c:/Doors-Stuff/DXL-Local/ folder that contains sibling folders 'Includes' and also 'InProgress' that appears in MY menus. My addins first point to the DXL-Local folder and THEN to the normal deployed location. Since it comes first the #include statement resolve to finding include files I have in DXL-Local/Includes folder which are the ones I currently have in development. If I need to run an important job on the production database and don't want to use developmental includes, I've got another DOORS icon that uses the '-a ' switch to just point to the addins on the network, bypassing my local client altogether. Be advised that the search order of directories appears to be as follows: [1] The current working Windows folder which is usually the last folder you clicked on in Windows Explorer [2] DOORSHOME/lib/dxl/addins [3] specified order of 'addins' or 'DOORSADDINS' variables. That first one is a shocker, discovered by one of the DOORS munchkins when faced with an error in my deployment instructions. You can thus cleverly rediriect include files by selecting a directory in Windows Explorer before invoking DOORS, and won't have to deal with extra icons or registry editing. - Louie |
|
![]() |
|
![]() |
|
I have a related question re include files.
I have a script that includes a link file with a statement like:
#include
|
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Use of #include
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.