CONCAT statement

Purpose: This statement will append one string to another.


 Syntax:

 CONCAT(Str1$, Str2$)

 Parameters:

  • Str1$ String to which Str2$ is added.
  • Str2$ String to add to Str1$

Remarks: The size of Str1$ must be dimensioned large enough to hold the combined size of Str1$ and Str2$.

Example:


 DIM Str1$ * 60000
 DIM Str2$
 DIM Start!
 DIM Elapsed!

 Start! = ROUND((float)clock()/(float)CLOCKS_PER_SEC,2)
 FOR INTEGER i = 1 TO 10000
    Str2$ = STR$(i)
    Str1$ = Str1$ + Str2$
 NEXT i
 Elapsed! = ROUND((float)clock()/(float)CLOCKS_PER_SEC,2)
 PRINT ""
 PRINT "Using Str1$ = Str1$ + Str2$ ", Elapsed! - Start!, " seconds"

 Str1$ = ""

 Start! = ROUND((float)clock()/(float)CLOCKS_PER_SEC,2)
 FOR INTEGER i = 1 TO 10000
    Str2$ = STR$(i)
    CONCAT(Str1$,Str2$)
 NEXT i
 Elapsed! = ROUND((float)clock()/(float)CLOCKS_PER_SEC,2)
 PRINT ""
 PRINT "Using CONCAT ", Elapsed! - Start!, " seconds"