[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: End-File



Gary,
I tested your code, and I do not get an infinite loop.  Make sure that your
text file has only three lines and only three lines... i.e. make sure that
your cursor can't proceed after the third line.  My .LIS file contained the
three lines to be printed, each being 10 lines apart and starting at the
character position 10 (since you have +10,10).

You may want to post your entire code to let us debug.  I pasted your code
in a bare bones template and was able to execute it without problem.

Michael K. Lee
mlee@agconsult.com
Consultant
AG Consulting, an ADP Company
http://www.agconsult.com





Gary Joynes <gary_joynes@HOTMAIL.COM> on 11/16/98 07:34:42 AM

Please respond to SQR-USERS@USA.NET

To:   Multiple recipients of list SQR-USERS <SQR-USERS@list.iex.net>
cc:    (bcc: Michael Lee/Application Group)
Subject:  End-File




Hello,

I am trying to process a text file and display it in an SQR report.  As
a test I created a three line text file e.g. :

Line1
Line22
Line333

I then wrote the following code to test I could iterate through the
file:

open 'c:\temp\test.txt' as 1 for-reading record=500:vary
  while 1
    read 1 into $temp:10
    if #end-file
        break
    end-if
    print $temp (+10, 10)
  end-while
close 1

This produces an infinite loop however.  A few various test showed that
#end-file was never set to 1 even when a string with an ascii value of 0
was being read in.

Has anyone any ideas?
Apologies for a garbled last message.  A slip of a mouse button.

Thanks,
Gary.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com