Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving backwards in a text file
Message
 
À
02/04/2004 15:11:55
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00891873
Message ID:
00891882
Vues:
12
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform