Ru the following code
temp.0 = 9
temp.1 = 'hello 09/03/2007-10:00'
temp.2 = 'hellohello 12/03/2007-11:00'
temp.3 = 'adam 12/04/2007-12:00'
temp.4 = 'eve 12/03/2007-10:00'
temp.5 = 'stockholm 12/03/2005-10:23'
temp.6 = 'london 28/05/2007-12:32'
temp.7 = 'me 12/03/2007-12:12'
temp.8 = 'yes 12/03/2007-12:12'
temp.9 = 'no 12/03/2007-12:12'
SORT temp. 18 a +4 15 b +2 12 c +2
DO i = 1 TO temp.0
SAY 'temp.'i' = 'temp.i
END
SAY '*****************************'
temp.0 = 9
temp.1 = 'hello 09/03/2007-10:00'
temp.2 = 'hellohello 12/03/2007-11:00'
temp.3 = 'adam 12/04/2007-12:00'
temp.4 = 'eve 12/03/2007-10:00'
temp.5 = 'stockholm 12/03/2005-10:23'
temp.6 = 'london 28/05/2007-12:32'
temp.7 = 'me 12/03/2007-12:12'
temp.8 = 'yes 12/03/2007-12:12'
temp.9 = 'no 12/03/2007-12:12'
off1 = 18 ; off2 = 15 ; off3 = 12
SORT temp. (off1) a +4 (off2) b +2 (off3) c +2
DO i = 1 TO temp.0
SAY 'temp.'i' = 'temp.i
END
SAY '*****************************'
The idea behind it is to sort the dates on yyyy, mm and dd. As can be seen, the only difference between the two variations is that one contains variables as offsets rather than hard-coded. |