Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you move the record with fseek()
Message
De
01/07/1999 12:56:22
 
 
À
30/06/1999 22:17:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00236108
Message ID:
00236547
Vues:
14
>>>>My code is
>>>>in_string = fgets(pipe_in)....
>>>>I want to move the record pointer back to the start of the line
>>>>just read in. The start of the line is not BOF. any ideas?
>>>>Sample code would help, thanks ... :)
>>>
>>>Save the current position in the file before issuing the FGETS(), and then do an FSEEK() back to that point in the file.
>>-----
>>Hi Ed and thanks for your reply...
>>Could you send me sample code on how to do that?
>
>It's fairly simple to do; FSEEK() returns the offset from the beginning of the file after it fires, so the following code fragment shows how to do an FGETS() and go back to where the file pointer was when you started:
>
>* nFH is the file handle returned by FOPEN()
>LOCAL lnFilePos, lcInputBuffer
>lnFilePos = FSEEK(nFH,0,1) && go 0 bytes from where you are
>lcInputBuffer = FGETS(nFH,max # of bytes to accept without a CR)
>=FSEEK(nFH,lnFilePos,0)
------------------------
Hi Ed and it works... thanks a lot for the code..... :)
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform