![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: #ifdef support? Topic Summary: Created On: 18-Jan-2007 21:35 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: quote: I think this covers your first question. You can use the eval_(string dxlCommand) function to conditionally include a file. For example, the dxl line: eval_("#include <addins\\test.dxl>") will execute the test.dxl file on the fly. You need to escape the \'s since the command is in a string. I've used this code to create a master GUI tool that can launch other DXL tools, each of which has their own dxl file. Also, I believe that the eval_ function is unsupported. So use it at your own risk. | |
![]() |
|
Does dxl support #ifdef?
If not, then is there another way to conditionally include a file? Also - Is there a way for a script to know if it is being called from another script? Thanks! Regards - Heather. ------------------------- Heather Linsk Lead Engineer General Dynamics AIS 413-494-7095 |
|
![]() |
|
![]() |
|
No, you cannot conditionally include a file; all inclusions are performed before any code is executed.
Perhaps the perm "dxlHere()" is what you want. - Louie |
|
![]() |
|
![]() |
|
quote: I think this covers your first question. You can use the eval_(string dxlCommand) function to conditionally include a file. For example, the dxl line: eval_("#include <addins\\test.dxl>") will execute the test.dxl file on the fly. You need to escape the \'s since the command is in a string. I've used this code to create a master GUI tool that can launch other DXL tools, each of which has their own dxl file. Also, I believe that the eval_ function is unsupported. So use it at your own risk. ------------------------- Brian Abts Software Engineer I AAI Corp. |
|
![]() |
|
![]() |
|
Hi Brian, Hi Heather,
there should be one hint to the eval_ function: The executed script will run in a new DXL context! So you will not be able to use variables, functions ... from evaluated code within the main code and the other way round! If you need to interface with evaluated code, you should pass varibales to it: example: int i = 5; string s = "Hello World"; Object o = object (5); Buffer evalDXLcode = create (); evalDXLcode += "int i = "i";\n"; evalDXLcode += "string s = "s";\n"; evalDXLcode += "Object o = addr_ ("(int addr_ o)");\n"; evalDXLcode += "#include <addins\\test.dxl>\n"; evalDXLcode += "return_ o.\"Object Text\"\"\"\";\n "; string result = eval_ (stringOf (evalDXLcode)); delete (evalDXLcode); You may return results with the return_ function. BTW: The eval_ is a supported function, because it is described in DOORS 8.1 API manual ![]() Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
Hope you don't mind Reik, I fixed a few bugs in that for you.
Some quotes were missing. ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
Thank you all for responding!
Brian - the eval_("#include"..") was exactly what I was looking for. I wanted to launch a GUI in it's own DXL context. Perfecto! Thank you again! Regards - Heather. ------------------------- Heather Linsk Lead Engineer General Dynamics AIS 413-494-7095 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
#ifdef support?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.