Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FSEEK() problems
Message
From
21/04/2003 08:56:47
 
 
To
21/04/2003 08:41:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00779708
Message ID:
00779730
Views:
13
Amanda,

Did you check the value of the handle returned by FOPEN()

Also, you do not need to FSEEK() inside your FOR ... ENDFOR loop since the FREAD() automatically moves the file pointer. You can just position the file at the start before the loop and then issue your FREAD statement inside the loop.


>Here is the code I am attempting (note that I split the text file into 4 700MB files and the fseek() works, but I would like to keep it in one file, if possible)
>
>
>gnFileHandle = FOPEN("tapes1212.dat")
>* Seek to end of file to determine the number of bytes in the file
>nSize =  FSEEK(gnFileHandle, 0, 2)     && Move pointer to EOF
>
>IF nSize <= 0
>	* If the file is empty, display an error message
>	WAIT WINDOW "This file is empty!" NOWAIT
>ELSE
>
>	* If file is not empty, the program stores its contents
>	* in memory, then displays the text on the main Visual FoxPro window
>	IF lCheck <> 'Y'
>		FOR X =0 TO nSize STEP 2264
>			= FSEEK(gnFileHandle, X)      && Move pointer to BOF
>			cString = FREAD(gnFileHandle, 2264)
>etc. etc. I process the data that comes in from here
>endfor
>endif
>
>
>Thanks!
>
>
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Reply
Map
View

Click here to load this message in the networking platform