I need to add two strings. One is very large (20 to 30 MB)
the other is smaller (around 1.5MB)
While Files
FOR i = 1 to 28000 ' or so
TempStr =TempStr + NewLine ' where NewLine is about 80 chars
NEXT
LargeStr = LargeStr + TempStr ' add latest file to exisiting
Loop
Each Time i add NewLine to TempStr the entire contents
of TempStr is copied in memory and the NewLine is added. This
is very time consuming and bogs down my program badly.
Then when I add TempStr to LargeStr there is a long wait also.
Is there a way to append to a string WITHOUT copying its contents
each time, like appending to a file on disk?
------------------
Kind Regards
Mike
the other is smaller (around 1.5MB)
While Files
FOR i = 1 to 28000 ' or so
TempStr =TempStr + NewLine ' where NewLine is about 80 chars
NEXT
LargeStr = LargeStr + TempStr ' add latest file to exisiting
Loop
Each Time i add NewLine to TempStr the entire contents
of TempStr is copied in memory and the NewLine is added. This
is very time consuming and bogs down my program badly.
Then when I add TempStr to LargeStr there is a long wait also.
Is there a way to append to a string WITHOUT copying its contents
each time, like appending to a file on disk?
------------------
Kind Regards
Mike
Comment