On 18/9/00 4:45 pm, James Parker <[EMAIL PROTECTED]> wrote:

> I'm reading a binary file a character at a time and looking for the
> end-of-file marker so I know when to stop reading but the read terminates
> before the entire file is read.  There seems to be an eof marker in the
> file that is not at the end of the file.  CharToNum(EOF) returns a 4
> which could appear at places other than the end of the file, right?
> Is the following correct?
> repeat forever
> read from file sourcefile for 1 character
> if the result is "eof" then exit repeat
> put it into var1
> end repeat

I'm not quite sure why you want to do this, why not:

read from file tSourceFile until eof

If you really do want to read char by char for some reason, you need to
alter line 3 above to be:

if it is eof then exit repeat

Eof is a constant so can't be put in quotes.

Note that reading and writing to files is (except in a few special cases)
generally easiest done with the URL commands.  E.g.:

put url ("binfile:"&tSourceFile) into tVariable



> Thanks,
> Jim Parker

Kevin Miller <[EMAIL PROTECTED]> <http://www.runrev.com/>
Runtime Revolution Limited (formerly Cross Worlds Computing).
Tel: +44 (0)131 672 2909.  Fax: +44 (0)1639 830 707.

Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to