Category : BASIC Source Code
Archive   : LB09D.ZIP
Filename : TEST.BAS

 
Output of file : TEST.BAS contained in archive : LB09D.ZIP

'
' This program accepts a sentence, then determines its
' approximate size, after which it breaks the sentence up
' into seperate words.
' Then ten numbers are asked for, and they are then
' bubble-sorted and displayed
'


dim test(20)

input "Type a sentence >"; s$
print "s$ is more than 20 chars and less then 50"
print len(s$) > 20 and len(s$) < 50
length = len(s$)

' break s$ up, one line per word
sLen = len(s$)
for count = 1 to sLen
c$ = mid$(s$,count,1)
copy$ = copy$ + c$
if c$ = " " then copy$ = copy$ + chr$(13)
next count
print copy$

' ask for 10 numbers to sort
for count = 1 to 10
print "Give me number "; count; " >";
input number
test(count) = number
next count

' outer sort loop
for outerCount = 1 to 10

' inner sort loop
for innerCount = 1 to 9

if test(innerCount) > test(innerCount + 1) then s = test(innerCount) : test(innerCount) = test(innerCount + 1) : test(innerCount + 1) = s

next innerCount
next outerCount

' view the sorted array
for count = 1 to 10
print test(count)
next count



  3 Responses to “Category : BASIC Source Code
Archive   : LB09D.ZIP
Filename : TEST.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/