I notice a thread (argument) on the PowerBASIC forum about the best way to concatenate a string. I thought I would extend that thread here and get your opinion/advice on concatenating a string. The only rule is the string must be populated with nulls. (CHR$(0)) Keep in mind that the string you create has to be deallocated (freed) before returning to the command prompt.
Here is the Script BASIC attempt for reference.
FOR idx = 1 TO 1000
this &= 0x0
NEXT
PRINT LEN(this),"\n"
jrs@jrs-laptop:~/sb/examples/test$ time scriba concat.sb
1000
real 0m0.006s
user 0m0.004s
sys 0m0.000s
100000
real 0m0.988s
user 0m0.948s
sys 0m0.036s
This example just allocates a 1,000,000 byte string of nulls.
this = STRING(1000000, 0)
PRINT LEN(this),"\n"
jrs@jrs-laptop:~/sb/examples/test$ time scriba 1milstr.sb
1000000
real 0m0.009s
user 0m0.004s
sys 0m0.000s
jrs@jrs-laptop:~/sb/examples/test$