Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fseek() and fgets()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00124862
Message ID:
00124875
Vues:
13
Sandy,

Try this approach instead if the lines are less thatn 254 characters in length:
create cursor temp1 ( cLine c(254) )
append from TheASCIIFile type sdf
scan
   replace cLine with Converted( cLine )
endscan
copy to TheASCIIFile type sdf
>Hello All,
>I have an app that needs to fopen an ascii file,
>fgets() pulls out the first string.
>I manipulate the data here and then;
>I need to overwrite the line with the new info.
>All this inside a DO while Not feof() loop;
>
>I am not using fputs() to write the line becuase various
>sources of these ascii files may have different carriage returns so I have determined before hand what the return is and store it in a variable. THis way I can =fwrite(maniupateed data + variable)
>
>My problem is I am not successfully moving down with the file
>pointer thus never gettting to FEOF().
>
>I know the length of each record and I also have a counter as I go down the file. SO, I could do an fseek() to the top of the fiel and then move down by string length * the counter.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform