Sorting Problem
Posted: Sun Apr 25, 2004 7:38 pm
I am stuck on a sort problem. I am not able to get them to sort in acending order correctly. Unfortunetly I cannot use a swap command in my problem.
So far I have:
Dim number$(20)
Dim class$(20)
for t = 1 to 4
Read number$(t), class$(t)
next t
for x = 1 to 15
if number$(x) > number$(x+1) then
temp = number$(x)
number$(x) = number$(x + 1)
number$(x + 1) = temp
print number$(x), class$(x)
end if
next x
thanks, any help would be appreciated. Still trying to learn QB.
So far I have:
Dim number$(20)
Dim class$(20)
for t = 1 to 4
Read number$(t), class$(t)
next t
for x = 1 to 15
if number$(x) > number$(x+1) then
temp = number$(x)
number$(x) = number$(x + 1)
number$(x + 1) = temp
print number$(x), class$(x)
end if
next x
thanks, any help would be appreciated. Still trying to learn QB.