2D array

gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

2D array

Post by gaurav.shetti »

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') ?
User avatar
John
Site Admin
Posts: 2625
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

2D array

Post by John »

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

2D array

Post by gaurav.shetti »

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 ?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

2D array

Post by mark »

gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

2D array

Post by gaurav.shetti »

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

2D array

Post by gaurav.shetti »

and 1 more question .. can you post the syntax for seraching for something within the xtree
User avatar
John
Site Admin
Posts: 2625
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

2D array

Post by John »

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