Category : Files from Magazines
Archive   : IBM9008.ZIP
Filename : TESTARRY.BAS

 
Output of file : TESTARRY.BAS contained in archive : IBM9008.ZIP
'----------------------------------------------------------------
'Test lookups from an array to compare to string tables
'----------------------------------------------------------------

DECLARE FUNCTION RandomSymbol$ ()

DIM A$(1000)
RANDOMIZE

PRINT "Testing array initialize and lookup"

A1! = TIMER
FOR I = 1 TO 1000
Q: A$(I) = RandomSymbol$
FOR J = 1 TO I - 1'Test for duplicates
IF A$(I) = A$(J) THEN GOTO Q:
NEXT J
LOCATE 1, 50: PRINT USING "#### \ \"; I; A$(I);
NEXT I
A2! = TIMER
PRINT A2! - A1!

FOR I = 1 TO 1000
Test$ = A$(1000)
FOR J = 1 TO 1000
IF A$(J) = Test$ THEN
EXIT FOR
END IF
NEXT J
NEXT I

A3! = TIMER
PRINT A3! - A2!

END

DEFINT A-Z
'----------------------------------------------------------------
'Create a random symbol that can be looked up
'----------------------------------------------------------------
FUNCTION RandomSymbol$

R$ = ""

FOR I = 1 TO INT(6 * RND + 5)

L1: C% = INT(26 * RND + 65) 'A to Z
IF C% = ASC("\") THEN GOTO L1:
R$ = R$ + CHR$(C%)

NEXT I

RandomSymbol$ = R$

END FUNCTION



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