![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() Answer: Ok. I think your script is slightly easier :-) | |
![]() |
|
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. |
|
![]() |
|
![]() |
|
Daniel , in the help file look at the find function similar to:
if (find(numberCache, 1, o)) { string h = o."Object Heading" ack h } |
|
![]() |
|
![]() |
|
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 .... |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
Ok. I think your script is slightly easier :-)
|
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
How to get Values from skiplist ?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.