On 10/12/2015 06:15 PM, David W Noon wrote:
On Mon, 12 Oct 2015 15:11:18 -0400, Wkitty42 (wkitt...@windstream.net)
wrote about "Re: [fpc-devel] Fwd: While - Otherwise Statement" (in
<561c05d6.4010...@windstream.net>):

On 10/12/2015 02:02 PM, Dmitry Boyarintsev wrote:

The next step would probably be controlled "break", where a user
would be able to specify how many nested loops needed to broken
from.

ROTFLMAO! if you need or desire something like that then set a
breakcounter and break... in the next outer block, check
breakcounter to see if you need to break again... if so,
dec(breakcounter) and break... then check it again in the next
outer block... and so on and so on until breakcounter=0... why
should the compiler have to do your logic work for you? ;)

Hi Mark,

hiya dave!! it has been a long time, my friend!!

You might have seen me write things like this in the old OS2PROG echo
of Fidonet some 20+ years ago. ... :-)

oh yeah! that echo still exists, too... but it only contains monthly moderator postings these days... it is ready for you any time you want to join back in... nntp access is available via some systems but the dawg grows older with each passing year :?

The only language I know that offers that level of control is PL/I,
where the break statement is coded as LEAVE.  It is handled by
labelling the loop control statement and coding the required label in
the LEAVE statement. For example:

that looks very much like what some would consider goto statements... does the leave return to the top of the previous loop or does it drop to the next statement in the previous loop?

If the label is omitted then the immediately containing loop is left.

"immediately containing loop" meaning loop_3 if we're in loop_3?

This allows any of the nested loops to be escaped, potentially all the
way out. I guess the corresponding syntax in a Pascal-esque style
would be:

that does look interesting for breaks and i can see how it may be beneficial and save some bit of coding but then those of us who have been around a while know how to work our way back out when necessary, right? ;)

If we're being strictly Pascal, the labels would need to be declared
at the head of the procedure -- and if we're really strict they should
be numeric.

yup! and i did catch the THEH->THEN oops... no problems there O:)

--
 NOTE: No off-list assistance is given without prior approval.
       *Please keep mailing list traffic on the list* unless
       private contact is specifically requested and granted.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to