' *** ASCIQSRT.LST *** 2nd GFA-Manual, page 5-6 > PROCEDURE ascii_qsort(n,VAR text\$()) ' ' *** Alphabetical sorting of string-array with byte-array ascii|() ' *** Lines 0 - n& are sorted (entire array if n& = -1) ' *** Special characters and uppercase/lowercase treated correctly ' *** Empty lines are moved to end of string-array ' ' *** Procedure: Init_ascii_array ' @init_ascii_array IF n=-1 QSORT text\$() WITH ascii|() ELSE QSORT text\$() WITH ascii|(),n ENDIF WHILE text\$(0)="" DELETE text\$(0) WEND RETURN > PROCEDURE init_ascii_array ' ' *** Create global byte-array ascii|() for use with QSORT/SSORT ' *** Using the array ascii|() special characters are treated correctly ' ' *** Global: ascii|() ' LOCAL i,code1,code2 IF DIM?(ascii|())=0 ! only necessary if ascii|() didn't exist DIM ascii|(255) ARRAYFILL ascii(),32 ! fill with space-character FOR i=48 TO 57 ascii|(i)=i ! 0 - 9 NEXT i FOR i=65 TO 90 ascii|(i)=i ! A - Z NEXT i FOR i=97 TO 122 ascii|(i)=SUB(i,32) ! convert a - z to A - Z NEXT i RESTORE ascii.data REPEAT READ code1,code2 ascii|(code1)=code2 UNTIL code1=0 ENDIF ' ascii.data: ' *** Format: ASCII-code,replacement DATA 128,67,129,85,130,69,131,65,132,65,133,65,134,65,135,67,136,69,137,69 DATA 138,69,139,73,140,73,141,73,142,65,143,65,144,69,145,65,146,65,147,79 DATA 148,79,149,79,150,85,151,85,152,121,153,79,154,85,155,67,158,83,160,65 DATA 161,73,162,79,163,85,164,78,165,78,166,65,167,79,176,65,177,79,178,79 DATA 179,79,180,79,181,79,182,65,183,65,184,79,192,121,193,121,225,83,0,0 RETURN ' ********* '