[comp.sys.mac.hypercard] Repeat until <syntax> ?

djnowak@luna.UUCP (David Nowak) (09/08/88)

I was recently writing a script to import and edit text data on the fly and
wished to set up a loop that would get a line of data, process it and continue
to do this until the end of the textfile.  Since my data would be in the
variable "it" I guessed that one could do this with the construct:

repeat until it is empty
   <get at line and process it commands>
end repeat

However, Hypertalk choked after the "it" in the "it is empty" expression.
Apparently "it is empty" does not evaluate to <true/false>.  Why not?

Dave Nowak
djnowak@luna.dpl.scg.hac.com

tomj@oakhill.UUCP (Tom Johnson) (09/09/88)

In article <172@luna.UUCP> djnowak@luna.UUCP (David Nowak) writes:
>I was recently writing a script to import and edit text data on the fly and
>wished to set up a loop that would get a line of data...
>repeat until it is empty
>   <get at line and process it commands>
>end repeat
>...
>Dave Nowak
>djnowak@luna.dpl.scg.hac.com

You can use the following (I just used this a few days ago):
   repeat
	<read a line from the text file>
	if it is empty exit repeat
	<process the input line>
   end repeat

Hope this helps...
---tomj