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: (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
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 Tara Wilk, on Tuesday, January 8, 2008 4:29 PM

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.
 8-Jan-2008 14:29
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

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
Report this to a Moderator Report this to a Moderator
 8-Jan-2008 14:38
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

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
Report this to a Moderator Report this to a Moderator
 8-Jan-2008 14:46
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

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
Report this to a Moderator Report this to a Moderator
 8-Jan-2008 15:01
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

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
Report this to a Moderator Report this to a Moderator
 8-Jan-2008 15:19
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

This code works fine for me.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 8-Jan-2008 15:28
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 8-Jan-2008 15:57
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

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
Report this to a Moderator Report this to a Moderator
 8-Jan-2008 16:04
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

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
Report this to a Moderator Report this to a Moderator
 8-Jan-2008 16:23
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

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
Report this to a Moderator Report this to a Moderator
 8-Jan-2008 16:29
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

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

-------------------------
Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time
Report this to a Moderator Report this to a Moderator
 8-Jan-2008 16:31
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

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
Report this to a Moderator Report this to a Moderator
 9-Jan-2008 01:10
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 9-Jan-2008 14:05
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 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 1 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.