Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy from a Cursor to text file
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01540524
Message ID:
01540544
Views:
29
>>>>>>>>select(padr(myCharFiled, 15, chr(0)) && pick the right character here.
>>>>>>>
>>>>>>>I will try it. Thank you.
>>>>>>
>>>>>>Try chr(0)
>>>>>
>>>>>You know what I thought. I can probably easily write my own procedure to store the values into the text file. And there, I can control the format and layout any way I want to.
>>>>
>>>>For not very big cursors, it will be a good approach. For big files it may be slow (say, with 2MB files and up).
>>>
>>>I can't think of the cases where this cursor will have more than 1000 or 2000 records. So this will be doable; I think.
>>
>>Ok, good then. I recommend to use low-level file functions rather that loading all into one string and saving at the end.
>
>I really don't know how to do it with a low level file function. So for now I am testing the approach with STRTOFILE(). Btw, do you think each line should be ended with CHR(13) + CHR(10) or just CHR(10)?

CHR(13) +CHR(10).

I suggest to save after each line into the file then. Actually, test both approaches - one to create only one long string and save at the end and another of saving one line with strtofile with .t. as third parameter to append. Low-level is also very simple: use fputs to output a new line.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform