Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving backwards in a text file
Message
 
To
02/04/2004 15:11:55
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00891873
Message ID:
00891882
Views:
11
>Hello,
>I have an application that using FGETS to go line by line through a text file. What I want to do is actaully do the reverse of FGETS, and go up a line in a text file. Anybody out there have any experience doing this?
>
>Thanks!!!
>
>MAC

You could use ALINES() and FILETOSTR() and iterate backward through the array.
lcstr = FILETOSTR(GETFILE('TXT'))
lnlast = ALINES(a_lines, lcstr)
FOR lni = lnlast TO 1 STEP -1
  * Do whatever to a_lines[lni]
NEXT
George

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

Click here to load this message in the networking platform