gaurav.shetti
Posts: 119 Joined: Fri Feb 27, 2009 9:09 am
Post
by gaurav.shetti » Fri Feb 27, 2009 9:14 am
Can we define a 2 dimensional array in vortex?
Do we have a method defined in vortex which checks whether an element exists in the array eg array.exists('element') ?
John
Site Admin
Posts: 2625 Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Post
by John » Fri Feb 27, 2009 9:53 am
You may find that xtree does what you want. Can you elaborate a little more, either here on via a tech support ticket?
John Turnbull
Thunderstone Software
gaurav.shetti
Posts: 119 Joined: Fri Feb 27, 2009 9:09 am
Post
by gaurav.shetti » Fri Feb 27, 2009 10:06 am
Xtree sounds good. The scenario is this..
I will query the database ,which should give me 0 or n results like 10125 10131 ...
i want to store this results into an array and then want a method which can search for me like ..
if array[2] contains 10125 ,10131 ... i want a method like array.exists(10125) to return true . Can you provide a solution using xtree for this ?
mark
Site Admin
Posts: 5519 Joined: Tue Apr 25, 2000 6:56 pm
Post
by mark » Fri Feb 27, 2009 10:55 am
Sounds like you want to do a search and keep track of item's you've seen and check those as you go.
Use <xtree insert> to add your items to the tree and <xtree search> to lookup items. See the manual at
http://www.thunderstone.com/site/vortexman/xtree.html
gaurav.shetti
Posts: 119 Joined: Fri Feb 27, 2009 9:09 am
Post
by gaurav.shetti » Fri Feb 27, 2009 10:57 am
is this declaration right :
<xtree XTREE=$personalNw INSERT $network $personalNw>
$network has the results from the sql query
gaurav.shetti
Posts: 119 Joined: Fri Feb 27, 2009 9:09 am
Post
by gaurav.shetti » Fri Feb 27, 2009 11:19 am
and 1 more question .. can you post the syntax for seraching for something within the xtree
John
Site Admin
Posts: 2625 Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Post
by John » Fri Feb 27, 2009 11:44 am
You only need one or the other $personalNw, e.g.
<xtree XTREE=$personalNw INSERT $network>
or
<xtree INSERT $network $personalNw>
to query:
<xtree ROW SEARCH $network $personalNw>
Found $ret $ret.count times
</xtree>
<if $loop eq 0>Not Found</if>
John Turnbull
Thunderstone Software