>I am reading a value from a flat file.
>I have a button on a form with the following code:
>CVALUE=FILETOSTR('C:\DWGNUM.TXT')
>? CVALUE
>
>Ok lets say the dwgnum.txt file consists of the following value '0001'
>
>I run my form press my button and voila the value '0001' is displayed...
>Now I don't close my form but I open dwgnum.txt and change the value to '0002' and save the file.
>
>Then I press my button again and OOPS... it displays '0001' again.
>I have to close and reopen the app not just the form to clear the value.
>How can I force VFP to read that file again instead of using what is in memory?
>I've tried the following with no luck in my button code:
>CLEAR RESOURCES ('C:\DWGNUM.TXT')
>CLEAR GETS
>FCLOSE(FOPEN('C:\DWGNUM.TXT'))
>
>Thanks
Steve,
Might it be that there is an error routine blocking error messages and actually you're getting a value you read from first time and file is not accessed later ?
Something like this I mean :
-When form loads you read it and say cValue is public
-You open the file elsewhere
-FileToStr can't open the file and error is suppressed somewhere
-It prints old value
Cetin