I have highlighted the errors with "XXX" and replaced the code.
The basic error is that an array[7] has 8 elements (0 - 7)
You haven't added a value to the last element, but have not printed it either so you can't see the mistake
Then you sort and the blank element shuffles to the top
Then you print again with the empty element at the top, and the last element omitted from the print (8)
// set window properties
SetWindowTitle( "sort" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
// XXX dim m$[7] = [ "1", "7", "3", "4", "2", "5", "6" ]
global m$ as string[7] = [ "1", "7", "3", "4", "2", "5", "6" , "8"]
clearscreen()
// XXX for i=0 to m$.length - 1
for i=0 to m$.length
print(str(i)+".["+m$[i]+"]")
next
print("sorting...")
m$.sort()
// XXX for i=0 to m$.length - 1
for i=0 to m$.length
print(str(i)+".["+m$[i]+"]")
next
sync()
do
loop
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt