Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing a tab delimited text file
Message
From
30/12/2003 12:43:55
 
 
To
30/12/2003 11:45:49
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00862449
Message ID:
00862894
Views:
21
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform