![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: (Yet Another) Question on Handling Baselines Topic Summary: Why am I drawing this error from DOORS/ Created On: 8-Jan-2008 14:29 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Just got my answer; Module module_of_interest = load(b, false) for o in module_of_interest do{ } I knew load returned a Module handle...just hadn't put it together yet. Thanks, Ron. | |
![]() |
|
I am using this code in a DXL script to attempt to build a skip list
of a module's baseline. I know the module has 5 good baselines, but the code stops after the first one with the error: // my debug stmt Baseline is ===>1.0Pre Rev-D Baseline<=== -R-E-DXL: <Line 13> unassigned variable reference -I-DXL: execution halted (Line 13 is the put statement.) Any ideas why this is occurring? Thanks, TW ------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time |
|
![]() |
|
![]() |
|
I think you need to initialize numBaselines....
You intialize I to 0 when you declare but your not intializing numBaselines when you declare, they your trying to increment a null integer variable. ------------------------- Scott Boisvert Engineering Tools Administrator L-3 Communications - Avionics Systems scott.boisvert@l-3com.com |
|
![]() |
|
![]() |
|
Also Tara, you're using an integer key for your skip list but you created it to use a string key. When using an integer key, use "create" to initialize the skip list. createString is only used when you explicitly want to use a string key.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Scott and David,
Thanks for the suggestions. Neither one pans out. (It turns out I am actually initializing numBaselines to 0 in the actual code...I just can't type from scratch online to save my soul.) (Also, changing from createString to create yielded no difference.) My only other question is: "Should I be able to use a variable of type Baseline as the input value for a Skip List?" (Or do I need to convert it to a string first?) Thanks again, Tara ------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time |
|
![]() |
|
![]() |
|
This code works fine for me.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
It appears that the following does not work as expected:
int numBaselines, I = 0 I tried this on DOORS 8.2 and the variable numBaselines is NOT initialised. I don't know if this has always been the case because I never declare variables like this. The following does work, but is messy: int numBaselines = 0, I = 0 I recommend always declaring and initialising variables individually - the following is much easier to read and maintain: int numBaselines = 0 int I = 0 ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
Tony...please reread my previous append. (The actual code
did say numBaselines = 0...my typing on this forum did not.) For Scott and David, I had mistyped in my code as well, referring in one spot to numBaselines, and another spot ro numBaseLines...oops. As the saying goes, "my bad". I do have one other curiosity I can't solve. Once my baselines are in a Skip list and I'm looping through them, inside of each baseline I want to loop through all objects in that baseline. At that point, I can't say "for o in mSrc"...it's too ambiguous (as evidenced by my output/results.) So how to I reference the module in the "for o in mSrc" on a baseline by baseline fashion? Thanks again, Tara ------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time |
|
![]() |
|
![]() |
|
You would have to "load" the baseline to a Module type variable. The DXL reference manual details the load function:
Module load([Module m,] Baseline b, bool display) Operation Loads baseline b of module m; and if the last argument is on or true, displays it. If the first argument is omitted, it uses the current module. Example This example loads baseline 1.0 (without a suffix) of the current module, without displaying it. load(baseline(1,0,null), false) Then you can do a "for o in baselineMod do" loop..... ------------------------- Scott Boisvert Engineering Tools Administrator L-3 Communications - Avionics Systems scott.boisvert@l-3com.com |
|
![]() |
|
![]() |
|
Scott,
I'm already using the load function successfully. It's just when I try to loop through the objects that the name of the module becomes ambiguous. My results are that I only get output from the last baseline, even though each baseline is loaded. ????? Thanks, Tara ------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time |
|
![]() |
|
![]() |
|
Just got my answer;
Module module_of_interest = load(b, false) for o in module_of_interest do{ } I knew load returned a Module handle...just hadn't put it together yet. Thanks, Ron. ------------------------- Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time |
|
![]() |
|
![]() |
|
ummm...
Hard to say without seeing the script, but I would make sure that prior to looping through the objects you are setting the baseline to the module variable.... Something like below...I know looping through baselines like this is not the way to go, but its just a quick example... ------------------------- Scott Boisvert Engineering Tools Administrator L-3 Communications - Avionics Systems scott.boisvert@l-3com.com |
|
![]() |
|
![]() |
|
Read this thread with much curiosity. Am going to repeat some of the responses as well as add some.
[1] *********** Auto Declare is a terrible thing *********** Whoever came up with that needs to be 2nd in line for the firing squad, after the guy who came up with a 2-digit 'year' creating the Y2K fiasco. Yes, its hard to spot "Baselines" vrs "BaseLines" typos. Look for 'Autodeclare' in the forums for the script I wrote to turn it on and off. Keep it off unless you are opening other folks module's who have layouts written with it on. [2] I like: int i = 0, ....j = 0. <spaces instead of periods> That's easier for me to read than: int i = 0 int j = 0 since I can group similar variables into a single declare 'block'. [3] Yes, keep the module handle when you 'load' the baseline. Yes CLOSE it when you are done. [4] You cannot convert a 'Baseline' into a string: s = bl "" will not work. You can, however, turn a Baseline into a baseine Designation e.g. "4.2(a)", store that, and later on look for that designation in all the baselines. In fact, that is how I had that baseline loop within a baseline loop problem so many years ago. [5] Yes, Skip lists that have a string as Key should ALWAYS be created with 'createString', all other skip's should use 'create'. It doesn't matter what type of Data it is, but the Data must ALWAYS be retrieved with the correct Type. Since DXL doesn't check the Types for you, you should be very careful when coding. - Louie |
|
![]() |
|
![]() |
|
I definitely agree with Louie on auto-declare. I turned it off a while ago. I don't like the idea of the compiler deciding what kind of variable I wanted.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
(Yet Another) Question on Handling Baselines
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.