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: DXLObject Array
Topic Summary: DXLObject Array
Created On: 24-Oct-2007 20:32
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.
 24-Oct-2007 20:32
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Did a little work with DXLObjects, declaring an array. See attached for example. Take note of these things:
[] the clever way to get 'new' in line 4 to get repeated SizeDXL times.
[] retrieving the data in line 11 should be typed (int and string). Take the 'int' out of line 11 and see what gets printed (for me its History type constants).
[] Consider the following use for this:
for usr in userList do; CountUsers++
DxlObject dUsers[CountUsers] = {int i; for (i=0; i<CountUsers; i++) new())
i = 0
for usr in userList do
{ dUsers->"Name" = usr.name
dUsers->"Email" = usr.email
dUsers->"Type" = usr.class
}

- Louie
Report this to a Moderator Report this to a Moderator
 25-Oct-2007 09:17
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

I make use of DxlObjects quite a lot.

I like the declaration trick Louie - never knew you could do that. Thanks.

It also works for other types.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 25-Oct-2007 09:54
User is offline View Users Profile Print this message


Peter Albert

Posts: 232
Joined: 30-Dec-2005

Yes, really nice. However, I'd like to suggest to add explicit deletion of the dxlObjects to the script; when called very often, e.g. in layoutDXL, memory consumptiom can grow up otherwise:

for (i=0; i<SizeDXL; i++){delete dDxl}

at the end of the script works fine for me.

Regards,

Peter


P.S.: Is it only me, or do you also see all text after the first closing curly bracket in italics? This forum has a life on its own...

Edited: 25-Oct-2007 at 09:56 by Peter Albert
Report this to a Moderator Report this to a Moderator
 25-Oct-2007 13:33
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Thanks for the info Louie. I might have to look into using these in the future.

quote:

Originally posted by: Peter Albert
P.S.: Is it only me, or do you also see all text after the first closing curly bracket in italics? This forum has a life on its own...


No. I see all the code in italics.

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


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I'm still an 'Amish Programmer', and while I dealt with clever 'structures' in school 'many' years ago, I've never had to deal with them since. I really don't see much use for these DxlObjects, as you can do just about the same thing with parellel arrays. Would be interested in seeing a practical example of using them.

When you say 'it also works for other types', are you talking about that clever line #4 construct will work for something other than DxlObjects?

- Louie
Report this to a Moderator Report this to a Moderator
 25-Oct-2007 16:13
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Yes, Louie.
I tried your clever line 4 and it works for an array of integers.

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