Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clearing a flat file from memory
Message
De
08/11/2001 12:16:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/11/2001 12:04:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00579164
Message ID:
00579183
Vues:
22
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform