Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Importing a tab delimited text file
Message
De
30/12/2003 12:43:55
 
 
À
30/12/2003 11:45:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00862449
Message ID:
00862894
Vues:
20
>I'm using VFP 5.0 and there is no FILETOSTR command. Is there an equivalent in VFP 5.0?

Here is something that's a UDF that's basicly the same thing
*---------------------------------------------------------------------*
* file2str - takes a file and returns it contents back                *
*---------------------------------------------------------------------*
FUNCTION FILE2STR
PARAMETER pc_file
PRIVATE ln_hndl, ln_size, lc_string
STORE 0 TO ln_hndl, ln_size
lc_string = SPACE(0)

IF TYPE('pc_file') = "C" .AND. FILE(pc_file)
   ln_hndl = FOPEN(pc_file)
   *-- Move to the bottom of the file
   ln_size = FSEEK(ln_hndl, 0, 2)
   *-- Move to the top
   =FSEEK(ln_hndl, 0, 0)
   lc_string = FREAD(ln_hndl, ln_size)
   =FCLOSE(ln_hndl)
ENDIF

RETURN (lc_string)
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform