Category : Files from Magazines
Archive   : VOL7N22.ZIP
Filename : QSORTFL.BAS

 
Output of file : QSORTFL.BAS contained in archive : VOL7N22.ZIP
reclen = 31
OPEN "FILE.DAT" FOR RANDOM AS #1 LEN = reclen
FIELD #1, reclen AS rec$
FIELD #1, 3 AS junk$, 10 AS keyvar$
numrecs = LOF(1) / reclen

ind = 1
WHILE ind <= numrecs
ind = ind + ind
npass.req% = npass.req% + 1
WEND
PRINT "Number of passes required is: "; npass.req% - 1

ind = (ind - 1) \ 2
WHILE ind
npass% = npass% + 1
LOCATE 2, 1
PRINT "PASS being processed:"; npass%
FOR I = 1 TO numrecs - ind
J = I
WHILE J > 0
GET #1, J: varJ$ = keyvar$: recJ$ = rec$
L = J + ind
GET #1, L: varL$ = keyvar$: recL$ = rec$
IF varJ$ > varL$ THEN
LSET rec$ = recJ$: PUT #1, L
LSET rec$ = recL$: PUT #1, J
J = J - ind
ELSE
J = 0
END IF
WEND
NEXT
ind = (ind - 1) \ 2
WEND

BEEP
PRINT "Done";
CLOSE



  3 Responses to “Category : Files from Magazines
Archive   : VOL7N22.ZIP
Filename : QSORTFL.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/