Quantcast
Channel: GSAK Forum
Viewing all articles
Browse latest Browse all 75076

Array sort ( array (1,-2)="D" problems by hynr - 2013-07-09

$
0
0
I can't confirm this with 8.3.1 builds 26 or27
The following shows that the behavior for array(1,-2) is the same as for array(2,-2). If you run this do you see improperly sorted sets for the second array?
GSK
array(1,0) = "5"
array(1,1) = "9"
array(1,2) = "100"
array(1,3) = "13"
array(1,4) = "50"
array(1,5) = "1001"

array(2,0) = "5"
array(2,1) = "9"
array(2,2) = "100"
array(2,3) = "13"
array(2,4) = "50"
array(2,5) = "1001"

$A=1
while $A<=2
array($A,-2) = ""
gosub Name=ShowArray
msgok msg="Array $A unsorted$_NewLine$d"

array($A,-2) = "D"
gosub Name=ShowArray
msgok msg="Array $A sorted descending as string$_NewLine$d"

array($A,-2) = "ND"
gosub Name=ShowArray
msgok msg="Array $A sorted descending as numeric$_NewLine$d"
$A=$A+1
Endwhile

Beginsub Name=ShowArray
$x = 1
$d = ""
while $x <= 5
 $d = $d + array($A,$x) + $_NewLine
 $x = $x + 1
EndWhile
endsub

Viewing all articles
Browse latest Browse all 75076

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>