Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Open a txt file
Message
De
17/09/2003 17:00:23
 
 
À
17/09/2003 16:48:20
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00830099
Message ID:
00830109
Vues:
21
>I just want to read the text.

for VFP 7 or +:

filetostr() will get all the content of file and store to a variable..

for VFP 6 or less, try it:
cwmydata = filetostring("c:\test1.txt")

FUNCTION filetostring
LPARAMETER lcdatafile
lndfh=FOPEN(lcdatafile)
lcparameter=""
IF  lndfh > 0
    nsize =  FSEEK(lndfh, 0, 2)           && Move to EOF
    IF  nsize <= 0                        && is empty
    ELSE
        = FSEEK(lndfh, 0, 0)
        DO WHILE NOT FEOF(lndfh)
            lcparameter=lcparameter+FREAD(lndfh,nsize)
            *
        ENDDO
        *
    ENDIF
    =FCLOSE(lndfh)
ELSE
    * Error opening data file
ENDIF
RETURN lcparameter
HTH
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform