Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fopen( ) and Fwrite( ) usage
Message
De
24/07/2001 06:24:57
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Fopen( ) and Fwrite( ) usage
Divers
Thread ID:
00534274
Message ID:
00534274
Vues:
34
hi everyone,

what is the problem of following code? i can open and get the values, but can't write the new value back to the file:
there is only 5 bytes in Number.dat: " 1234".

FileID=fopen("Number.dat")
if FileID <> -1 then
  tempStr=fgets(FileID, 40)
  tempNum=val(tempStr)
  tempStr=padl(allt(str(tempNum+1)), 5, " ")
  fwrite(FileID, tempStr) && return 0 at this line, i.e. can't write
endif
I have tried fwrite(FileID, "tempStr") and fwrite(FileID, &tempStr), both not work.

thanks in advance!
error(503): file structure failure, signature file corrupted.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform