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: How to get Values from skiplist ?
Topic Summary: How to get Values from skiplist without a loop ?
Created On: 11-Oct-2007 13:39
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 Daniel Kübert, on Thursday, October 11, 2007 4:33 PM

Answer:
Ok. I think your script is slightly easier :-)
 11-Oct-2007 13:39
User is offline View Users Profile Print this message


Daniel Kübert

Posts: 10
Joined: 27-Sep-2007

Hi all,

i´m trying to get the  values back stored in a Skiplist.
How can I get the Value for a Key with a "get" command ?

 THX for your help.
Report this to a Moderator Report this to a Moderator
 11-Oct-2007 14:48
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Daniel , in the help file look at the find function similar to:

if (find(numberCache, 1, o)) {
string h = o."Object Heading"
ack h
}
Report this to a Moderator Report this to a Moderator
 11-Oct-2007 15:57
User is offline View Users Profile Print this message


Daniel Kübert

Posts: 10
Joined: 27-Sep-2007

Thx Ron, but i think the find function only returns true or false. I´ve written a short function on my own.
I thought there should be a simple get function ....

Report this to a Moderator Report this to a Moderator
 11-Oct-2007 16:21
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Daniel, While you are correct in that "find: return a boolean it also returns the data by value.

I modified your initial code to work with a find:

Skip Skip1
Skip1 = createString()
string s
put(Skip1,"KEY 1", "Wert 1")
put(Skip1,"KEY 2", "Wert 2")
if(find(Skip1,"KEY 1", s)) print s
Report this to a Moderator Report this to a Moderator
 11-Oct-2007 16:33
User is offline View Users Profile Print this message


Daniel Kübert

Posts: 10
Joined: 27-Sep-2007

Answer Answer
Ok. I think your script is slightly easier :-)
Report this to a Moderator Report this to a Moderator
 11-Oct-2007 18:51
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Yes, use the find command with 2 parameters (Skip, Key) if you only care to find out if the Key is in the Skip; use an optional output 3rd parameter Data if you are after the Data of the Key if found.

Here's the part of the DXL manual:
find (entry)
Declaration
bool find(Skip s,
type1 key
[,type2 &data])

The brackets[] indicate an optional parameter. The ampersand & indicates its an output from the function. Thus, this find command has two versions, a 2-param and a 3-param.

Not mentioned is that you had BETTER make sure the Key and Data used in find are exactly the same as used during put.

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