Category : Files from Magazines
Archive   : VOL8N5.ZIP
Filename : SORT.BAS

 
Output of file : SORT.BAS contained in archive : VOL8N5.ZIP

DEFINT A-Z
CLS

DIM Array(20) 'create and fill a test array
FOR X = 0 TO 20
Array(X) = RND(1) * 1000
PRINT Array(X)
NEXT

Done = -1 'this is required to initialize Sort
DO
PRINT "."; 'do anything you want here
GOSUB BSort
LOOP UNTIL Done

FOR X = 0 TO 20 'show that it was sorted correctly
LOCATE X + 1, 15
PRINT Array(X)
NEXT
END

BSort:
IF NOT Done GOTO MoreSort
Size = UBOUND(Array, 1) - 1
LoLimit = LBOUND(Array, 1)
Done = 0
FOR X = Size TO LoBound STEP -1
FOR Y = LoBound TO X
IF Array(Y) > Array(Y + 1) THEN
SWAP Array(Y), Array(Y + 1)
END IF
NEXT
RETURN 'exit after each pass
MoreSort:
NEXT
Done = -1
RETURN



  3 Responses to “Category : Files from Magazines
Archive   : VOL8N5.ZIP
Filename : SORT.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/