Thanks a lot guys (and gals).
I guess bubble it is then. Noted the point about big arrays Goepaz.
I also found this site about VBSCRIPT sorting
here.
| Riccardo Quintan from stackoverflow.com wrote: |
for a = UBound(ArrayOfTerms) - 1 To 0 Step -1
for j= 0 to a
if ArrayOfTerms(j)>ArrayOfTerms(j+1) then
temp=ArrayOfTerms(j+1)
ArrayOfTerms(j+1)=ArrayOfTerms(j)
ArrayOfTerms(j)=temp
end if
next
next
|
So I said. Lets write it in Commodore BASIC.
| Code: |
10 rem load array with unsorted text
20 upper=6:rem upper boundery
30 dim b$(upper)
40 b$(0)="how"
50 b$(1)="hello"
60 b$(2)="are"
70 b$(3)="you"
80 b$(4)="test"
90 b$(5)="not bad"
100 rem sort array
110 for a=upper-1 to 0 step-1:forj=0toa
120 z$=b$(j):x$=b$(j+1)
130 ifz$>x$thenb$(j+1)=z$:b$(j)=x$
140 next:next
200 rem print sorted array
210 fora=0to5 step+1
220 printb$(a)
230 next |
LOL.
It works.
_________________