Computer Science Canada

sorting an array

Author:  soulgnat [ Fri Jan 09, 2004 8:38 pm ]
Post subject:  sorting an array

i've gotten codes before about sortin an array such as

for i:1..upper(names)-1
for j:i+1,upper(names)
if names(j)<names(i) then
end if
end for
end for

but i want random numbers entered by user to be sorted in an ascending order..could someone give me the code and explain it to me? i know you have to compare and use the if structure, but im not clear on it..thanx so much peeps

Author:  Andy [ Fri Jan 09, 2004 9:16 pm ]
Post subject: 

what you do is have a for loop to save the data inputted by the user into an array then sort it using the method u posted... unless i misunderstood u