#53878 - 2001-02-14 06:47 PM
limits on arrays
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
Does anyone know what the upper limit on array sizes within KiX is? I need to do a recursive searchs through a bunch of files to look for duplicate entries and want to be able to dump the results into an array.Thanks ------------------
"He was a good little monkey and always very curious..."
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#53881 - 2001-02-14 07:10 PM
Re: limits on arrays
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
Sweet. Thanks. Now I just need to write a little routine to parse the array for dups.
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#53882 - 2001-02-14 07:12 PM
Re: limits on arrays
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
OK got another one. I must be blind or something but I can't find it.... I used the val() statement to convert a string to a value, now how do I convert it back to a string?
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#53885 - 2001-02-14 07:20 PM
Re: limits on arrays
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
damn.... I have like 15k records to search. I guess I'll just have to dump it to a CSV and search that. I would rather search for dups within the script. suggestions?
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#53886 - 2001-02-14 07:22 PM
Re: limits on arrays
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
Nevermind my second question. I forgot the " Need more sleep  ------------------
"He was a good little monkey and always very curious..."
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#53889 - 2001-02-14 07:39 PM
Re: limits on arrays
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
The input doesn't matter. I wanted to take input (string from a file, stdin, whatever) and dump in into an array and then search for duplicates. As soon as it find a dup it just returns the value.------------------
"He was a good little monkey and always very curious..."
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#53891 - 2001-02-14 07:59 PM
Re: limits on arrays
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
It's the contents of an array that I'm looking for dups in. In this particular case, the records each come from separate files.I was thinking of doing something like the following code:
i = 0 j = 0 last = 0while i < last j = i while j < last if array[i] = array[j] exit loop endif j = j + 1 loop i = i + 1 loop
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#53893 - 2001-02-14 08:10 PM
Re: limits on arrays
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
That works. Could you Email it to me?Thanks
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
#53894 - 2001-02-14 08:25 PM
Re: limits on arrays
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Quickly adapted for strings... code:
break on ; Sorts an array in reverse order ...
$elements = 10 dim $array[$elements] $array[0] = "Paul" $array[1] = "Bryce" $array[2] = "CeeJay" $array[3] = "Roger" $array[4] = "Erik" $array[5] = "Jack" $array[6] = "Radimus" $array[7] = "Ruud" $array[8] = "Henri" $array[9] = "Ursula"
; Straight selection sort ...
$i = 0 while $i < $elements - 1 $k = $i $min = $array[$k] $j = $i + 1 while $j < $elements if $array[$j] > $min $k = $j $min = $array[$k] $array[$k] = $array[$i] $array[$i] = $min endif $j = $j + 1 loop $i = $i + 1 loop
; Print it out ...
$i = 0 while $i < $elements ?"array[$i] = " $array[$i] $i = $i + 1 loop
exit
Shawn. [This message has been edited by Shawn (edited 14 February 2001).]
|
|
Top
|
|
|
|
#53897 - 2001-02-14 11:01 PM
Re: limits on arrays
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
What I ended up doing is having it dump the information to a CSV and I used Access to sort/find the duplicate records.I didn't feel like waiting for it to parse through 16k records with recursion  ------------------
"He was a good little monkey and always very curious..."
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 1133 anonymous users online.
|
|
|