BCX Console Demonstration Program s89.bas

 ' ----------------------------------------------------------------------- 
 ' Sample Snippet for BCX.     Quickly copy one String Array to Another 
 ' by Kevin Diggins 
 ' ----------------------------------------------------------------------- 
 DIM A$[21]
 DIM B$[21]
 DIM C
 
 FOR C = 1 TO 20
   A$[C] = "This Is Line No. " & STR$(C)
 NEXT
 
 StrArrayCopy(B$[0], A$[0], 20 * 2048) 'copy A$ array to B$ array 
 
 FOR C = 1 TO 20
   PRINT B$[C]
 NEXT
 
 SUB StrArrayCopy(Des$, Src$, ByteCount)
   memcpy(Des$, Src$, ByteCount)    'memcpy is a standard "C" function 
 END SUB

Result:


 This Is Line No.  1
 This Is Line No.  2
 This Is Line No.  3
 This Is Line No.  4
 This Is Line No.  5
 This Is Line No.  6
 This Is Line No.  7
 This Is Line No.  8
 This Is Line No.  9
 This Is Line No.  10
 This Is Line No.  11
 This Is Line No.  12
 This Is Line No.  13
 This Is Line No.  14
 This Is Line No.  15
 This Is Line No.  16
 This Is Line No.  17
 This Is Line No.  18
 This Is Line No.  19
 This Is Line No.  20