Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fopen( ) and Fwrite( ) usage
Message
From
24/07/2001 06:24:57
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Fopen( ) and Fwrite( ) usage
Miscellaneous
Thread ID:
00534274
Message ID:
00534274
Views:
35
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.
Next
Reply
Map
View

Click here to load this message in the networking platform