Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Text file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Versions des environnements
Visual FoxPro:
VFP 6
Database:
MS SQL Server
Divers
Thread ID:
01043078
Message ID:
01043097
Vues:
10
I would do it differently.
lcFileName = "..."
IF FILE(lcFileName)
  .txtbxdefault.Value = FILETOSTR(lcFileName)
ELSE
  STRTOFILE("", lcFileName)
ENDIF
I's also not a good idea to store any files in the root of C: drive.

>Here is my code
>IF FILE('C:\Swini.txt')= .F.  && Does file exist?
>        = FCREATE('C:\Swini.txt')  && If not create it
>    ELSE
>        gnFileHandle = FOPEN('C:\Swini.txt',0)
>        nSize =  FSEEK(gnFileHandle, 0, 2)     && Move pointer to EOF
>        IF nSize > 0
>            = FSEEK(gnFileHandle, 0, 0)      && Move pointer to BOF
>            .txtbxdefault.Value = Alltrim(FREAD(gnFileHandle, nSize))
>        ENDIF
>    ENDIF
>    = FCLOSE(gnFileHandle)
>However, next time I need to execute the same routine, fopen() returns -1, even though the file is not open. Thus, how can I open the file using fopen()
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform