Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String manipulation in VFP6
Message
From
25/06/2001 16:26:23
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:
00523242
Views:
11
Brien,

Thanks, this is exactly what I was looking for. This greatly improved the speed of my routine.

Thanks,

Jerryt


>
>LOCAL lcLine, lnI, lnInput, lnOutput
>
>lnInput = FOPEN(<filename>)
>lnOutput = FCREATE(<filename>)
>DO WHILE !FEOF(lnInput)
>  lcLine = CHRTRAN(FGETS(lnInput),CHR(10) + CHR(13),"")
>  FOR lnI = 1 TO LEN(lcLine) STEP 80
>    FPUTS(lnOutput,SUBSTR(lcLine,lnI,lnI + 79))
>  ENDFOR
>ENDDO
>FCLOSE(lnInput)
>FCLOSE(lnOutput)
>
>
>This is off the top of my head - I didn't test it, but I hope it helps!
>
>>The in comming file is variable length records. Each record is separated by CRLF. So I have to read each character until I my counter reaches 80 then start over on a new line, or until I reach a CRLF then start a new line.
>>
>>The output will have a maximum of 80 character per line.
>>
>>I am looking at the FGETS(). Maybe I can process each line one at time.
>>
>>Thanks,
>>
>>Jerryt
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform