home *** CD-ROM | disk | FTP | other *** search
- 0 rem--ahoy!--may issue--arrays--prog page 69
- 5 n=4
- 10 for i=1 to n:read n$(i),a(i):next i
- 20 data amy,25,abe,12,arthur,30,anne,5
- 30 rem - sort by name -
- 40 for i=1 to n
- 50 for j=i to n
- 60 if n$(i)>n$(j) then gosub 1000
- 70 next j
- 80 next i
- 90 for i=1 to n:print n$(i),a(i):next
- 100 end
- 990 rem - swap names and ages -
- 1000 t$=n$(i):n$(i)=n$(j):n$(j)=t$
- 1010 t=a(i):a(i)=a(j):a(j)=t
- 1020 return
-