Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replacement for COPY filea + fileb
Message
From
26/06/2001 09:17:23
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00523508
Message ID:
00523512
Views:
8
Hi!

There are no simple way of doing that. Basically, you can do following:
#DEFINE ChunkSize 10
...
nHandle=fcreate("OutputFile")
do while !eof()
   copy to ("Temp.txt") next ChunkSize delimited with '`' with character '^' fields ...
   if !eof()
      skip
   endif
   lcStr = filetostr("Temp.txt")
   * process lcStr here using string functions, such as chrtran, strtran etc.
   ...
   fwrite(nHandle,lcStr)
enddo
fclose(nHandle)
Above is the most quick way by using native VFP way. Adjust the ChunkSize to get as best performance as possible - tuning between speed of copy to cmmand+getting file into string AND speed of the string parsing (longer string - slower parsing). Too little value will cause slow down on the copy to command. Too large will slow down the string parsing. String parsing would be quite quick if you will use the quick string parsing algorithm in VFP.

HTH.

>Hi,
>
>I appreciate that this may not be a pure VFP question.
>
>I would like to be able to combine 2 files (specifically a PCL font in the same way that you used be able to in DOS with COPY filea + fileb filec. Is there a simple way of doing this maybe with the WINAPI.
>
>I am reluctant to use FOPEN(), FREAD(), FWRITE etc as some of these files are in excess of 250K, which would mean having to read in and write out 64K or less chunks at a time ( am I right in thinking that this is the max size for a variable in VFP). I'd prefer not to do it this way if there is a simpler way
>
>Thanks
>
>
>Simon Horne
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform