Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String manipulation in VFP6
Message
 
To
22/06/2001 12:00:58
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00522546
Message ID:
00522553
Views:
14
>Using VFP6 SP4
>
>Are there any article on string manipulation in VFP6?
>
>I need to write a generic routine to parse any text file into 80 character lines and output these lines into a new text file, for sending up into a mainframe.
>
>I am currently grabbing the file with the STRTOFILE() into a memvar then I go through each character 1 character at a time to create this file. I also do some other testing but this is the idea.
>
>However, this technic seems slow, especially on a large text file.
>
>Any help would be great.
>
>Thanks,
>
Jerryt,

If it's fixed at 80
lcstring = FILETOSTR(lcfilename)
lcnewstring = ""
lcCF_TEXT = CHR(13) + CHR(10)
DO WHILE NOT EMPTY(lcstring)
  lcnewstring = lcnewstring + lcCF_TEXT + LEFT(lcstring, 80)
  lcstring = SUBSTR(lcstring, 81)
ENDDO
lcnewstring = SUBSTR(lcnewstring, 3)
= STRTOFILE(lcnewstring, lcnewfile)
Note that this is just off the top of my head and I haven't debugged it.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform