Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Allocating memory to variable
Message
 
 
To
26/11/2009 23:52:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MySQL
Miscellaneous
Thread ID:
01436706
Message ID:
01436979
Views:
59
This message has been marked as a message which has helped to the initial question of the thread.
Christian,

Use the SET TEXTMERGE commands to most quickly output this sort of file. The only "trick" to keep from getting an empty first line is to code it like this
set textmerge to yourfile.txt
set textmerge on noshow
scan
   \\<<whatever you are outputting>>
   \
endscan
set textmerge off
set textmerge to
>Hello,
>
>I need to do the following:
>1) Query 100,000 lines from different tables and extract a string of about 200 characters per line,
>2) Add each line to a variable plus line break,
>3) Create a file (using StrToFile()) from the variable.
>
>I wonder how I can prevent performance problems by calling 100,000 times lcString = lcString + lcLine. This is going to re-allocate memory all the time, and I like to pre-allocate the needed memory for best performance. I remember having read an article about this many years ago (from Christopher) but I really do not remember anything about it, so I would be very thankful if somebody would give me a tip.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform