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:
01540545
Views:
25
>>>>>>>>>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.

I think the suggestion of saving each line is a good one. Thank you. Right now, I just need to give them a test .TXT file to see if they like it.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform