BCX Console Demonstration Program s145.bas

 OPTION BASE 1
 
 DIM DYNAMIC A$[100]        'Dynamic string arrays default to OPTION BASE 1 
 
 FOR INTEGER I = 1 TO 100
   A$[I] = "A$[] ... THIS IS LINE" & STR$(I)
   PRINT A$[I]
 NEXT
 
 FREE DYNAMIC A$ ' Release memory back to the operating system 
 FREE DYNAMIC A$ ' An intentional error -- BCX handles it automatically 
 
 CALL FOO_TEST
 
 SUB FOO_TEST()
   DIM RAW E = 100
   DIM DYNAMIC A$[E]
   DIM DYNAMIC B$[E]
   DIM DYNAMIC C$[E]
   DIM DYNAMIC D$[E]
 
   PRINT "Storing Items In A$[]"
   FOR INTEGER I = 1 TO E
     A$[I] = "A$[] ... THIS IS LINE " & STR$(I)
   NEXT
 
   PRINT "Storing Items In B$[]"
   FOR INTEGER I = 1 TO E
     B$[I] = "B$[] ... THIS IS LINE " & STR$(I)
   NEXT
 
   PRINT "Storing Items In C$[]"
   FOR INTEGER I = 1 TO E
     C$[I] = "C$[] ... THIS IS LINE " & STR$(I)
   NEXT
 
   PRINT "Storing Items In D$[]"
   FOR INTEGER I = 1 TO E
     D$[I] = "D$[] ... THIS IS LINE " & STR$(I)
   NEXT
 
   FOR INTEGER I = 1 TO E
     PRINT A$[I]
     PRINT B$[I]
     PRINT C$[I]
     PRINT D$[I]
   NEXT
 
 END SUB