1. RE: WISHLIST.TXT
> -----Original Message-----
> From: Derek Parnell [mailto:ddparnell at bigpond.com]
>> From: <christian.cuvier at education.gouv.fr>
> >
> > while <cond1> do
> > ...
> > if <cond2> then end while end if
> > ...
> > if <cond3> then end while end if
> > ...
> > end while
> Not really. By "end loop" I assume you are telling the
> interpreter to finish
> looping through the current loop block. If so, what is the difference
> between "end loop" and the current "exit" statement?
No, he means to go back to the top of the loop for the next iteration.
Here's a silly example:
for i = 1 to 10
if remainder(i,3) = 0 then
resume
end if
printf(1, "%d is divisible by 3!\n", i)
end for
So you should see:
3
6
9
I typically use a big if statement to do that sort of thing (of course this
is really trivial):
for i = 1 to 10
if remainder(i,3) != 0 then
printf(1, "%d is divisible by 3!\n", i)
end if
end for
I suspect that this shouldn't be terribly difficult to do in the source. I
*think* I see an easy way to do it by basically adding a case (or two). The
only thing that would slow me down would be adding stuff into the parser,
which I haven't done yet--a lot of that stuff is still a black box to me. :)
The controlled exit looks like it would take some more work--mainly checking
to see how many/which loops you need to wrap up.
Matt Lewis
2. RE: WISHLIST.TXT
- Posted by kbochert at copper.net
Aug 23, 2002
-------Phoenix-Boundary-07081998-
>I suspect that this shouldn't be terribly difficult to do in the source. I
>*think* I see an easy way to do it by basically adding a case (or two).
>The
>only thing that would slow me down would be adding stuff into the parser,
>which I haven't done yet--a lot of that stuff is still a black box to me.
>:)
>
>The controlled exit looks like it would take some more work--mainly
>checking
>to see how many/which loops you need to wrap up.
The 'exit' instruction itself is a plain and simple goto.
The same would be true of 'continue' or 'exit(n)'. The only difference
is the compile-time determination of where to jump to.
When the compiler handles 'end ...' it resolves a list of outstanding
'exits'. It would not be difficult to associate a decrementing count
with each exit, which could post pone the resolution
Karl Bochert
-------Phoenix-Boundary-07081998---