Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Low-level file problems.
Message
De
19/03/2003 09:48:01
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Low-level file problems.
Divers
Thread ID:
00767529
Message ID:
00767529
Vues:
39
Not being that familiar with low level file manipulation, i've encountered something that doesnt make good sense to me.
I have the following code:

lnFH = FOPEN('myfile.txt')
do while not feof(lnFH)
&& some other code here
enddo
fclose(lnFH)



The code above works fine on the first pass, but in order to get it to fire off again, I have to close vfp completely. On the second try, it is not going inside the DO/ENDDO. So logically I assume that the file pointer is moved to the end of the file from the first pass. I would have thought that it would have reset itself to the beginning by issuing the fclose?

Anyways, with this in mind, I tried moving the pointer to the beginning with:

lnFH = FOPEN('myfile.txt')
=FSEEK(lnFH,0,0) && GO TOP
do while not feof(lnFH)
&& some other code here
enddo
fclose(lnFH)

Well that still didnt work??

Furthermore I tried ? fseek(lnFH,0,1) and it returns 0. Isnt that the beginning of the file?

THis is probably one of those DUH moments, I must be overlooking the obvious.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform