BCX Console Demonstration Program s04.bas

DIM A$[1000]
DIM Junk$
DIM Counter
DIM Total

PRINT "Creating and storing 1,000 Strings ... Please Wait"

FOR Counter = 0 TO 999
  A$[Counter] = "This Is Line " & STR$(Counter)
  WHILE LEN(A$[Counter]) < 79
    A$[Counter] = A$[Counter] & "*"
  WEND
  Total = Total + LEN(A$[Counter])
NEXT Counter

?  "-------------------------------------"
?  "Total Bytes stored in array =", Total
?  "-------------------------------------"
INPUT "Press Enter To Display The Array " , Junk$

FOR Counter = 0 TO 999
  PRINT A$[Counter]
NEXT Counter

Result:

Creating and storing 1,000 Strings ... Please Wait
-------------------------------------
Total Bytes stored in array = 79000
-------------------------------------
Press Enter To Display The Array
This Is Line  0****************************************************************
...
This Is Line  999**************************************************************