#78094 - 2001-07-16 04:23 PM
Re: SortArray() : My function No. 34 (but the first published)
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
Hiya,header Row exclusion support added (updated first message, deleted all annoying 'edited by' entries), decided to do the easy things first  sample :
code:
break on cls call "path\SortArray.udf" dim $array[5] $array[0] = "Location","Name","Member No." $array[1] = "Stuttgart","jpols",611 $array[2] = "Houston","Bryce",600 $array[3] = "Toronto","Shawn",173 $array[4] = "Brisbane","cj",677 $array[5] = "Jyvaeskylae","Lonkero",2306 $array = SortArray($array,1,3,1) ;ascending by Member No.($array[x][2]),'header row' excluded for $rc = 0 to ubound($array) for $col = 0 to ubound($array[$rc]) at($rc*2,$col*15)$array[$rc][$col] next next get $
will now return :code:
Location Name Member No.Toronto Shawn 173 Houston Bryce 600 Stuttgart jpols 611 Brisbane cj 677 Jyvaeskylae Lonkero 2306
Jochen [ 16 July 2001: Message edited by: jpols ] [ 19 July 2001: Message edited by: jpols ]
_________________________
|
Top
|
|
|
|
#78096 - 2001-07-20 12:35 AM
Re: SortArray() : My function No. 34 (but the first published)
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
hmmm,'bug report' sended to Ruud , in the mean time here is a Version that Works with RC1 build 45 only (Note also the ammended example) SortArray_build45.udf
code:
forget the code , i was enlightened by Ruud 
Check your existing scripts for inconsistencies (esp. all who received build 43) !!!!!
Jochen PS.: The 'bug' is a feature - dim $array[3] will now create an array with 4 elements $array[0] to [3] (as it should do )
so the code wasn't false only the dimension was not up-to-date ! if you want to use SortArray() with build 45 (and i'm shure you'll throw away the Beta releases !) the example should be : code:
dim $array[5] $array[0] = "Location","Name","Member No." $array[1] = "Stuttgart","jpols",611 $array[2] = "Houston","Bryce",600 $array[3] = "Toronto","Shawn",173 $array[4] = "Brisbane","cj",677 $array[5] = "Jyvaeskylae","Lonkero",2306 $array = SortArray($array,1,3,1) ;ascending by Member No.($array[x][2]),'header row' excluded for $rc = 0 to ubound($array) for $col = 0 to ubound($array[$rc]) at($rc*2,$col*15)$array[$rc][$col] next next get $
Jochen [ 19 July 2001: Message edited by: jpols ]
_________________________
|
Top
|
|
|
|
Moderator: ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 581 anonymous users online.
|
|
|