[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Procedures
Rick, Sam, Don, et al,
> P.S. Maybe Ray can add BREAKability to IFs in the SQR wish list for ver. 7.
A lot of existing code will break if BREAK is added to IF.
BREAK is often used within a WHILE to conditionally break
the loop.
Some other languages allow you to specify the number of
levels of nesting you wish to BREAK by putting a numeric
argument after the BREAK keyword, but I think that this
is unwise. It seems odd to allow an inner control structure
to affect the processing of an outer structure.
I think that the use of GOTO that has been discussed here
is quite appropriate.
I DO wish that SQR had an ELSE IF structure, however.
Ray
> >>> donm@ONTKO.COM 07/12/00 19:01 PM >>>
> On Wed, 12 Jul 2000 Rick_Creel@AONCONS.COM wrote:
>
> > If he is using several IF statements, then I believe the GOTO is the
> > only way to get to the end of a procedure.
>
> Actually, if statements can be nested. So...
>
> begin-procedure example
> if #w
> (misc. lines of code)
> else
> if #x
> (misc. lines of code)
> else
> if #y
> (misc. lines of code)
> else
> (misc. lines of code)
> end-if
> end-if
> end-if
> end-procedure example
>
> ...is perfectly workable.
>
> -----------------------------------------------------------------------
> Donald Mellen | Ray Ontko & Co. - Richmond, IN - http://www.ontko.com/
> donm@ontko.com | "In the beginning, there was nothing, which exploded"
>
----------------------------------------------------------------------
Ray Ontko rayo@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/