1. Re: Short Circuiting + Return in procedures

Lmailles at AOL.COM wrote:
>
> However, we have
>
> "exit"
> from loops
> "return"
> from rountines and
> "abort"
> from main routine.
>
> Is this not an unnecessary complication ? Would it hurt anyone to allow "exit"
> from a procedure Rob ? I think that having "return x" in a procedure would be
> extremely confusing for a newbie and hints of other inferior languages which
> allow you to do naughty things like not returning values from functions.
>
> -Daniel

I prefer to have clearly distinct statments for each one. Encourages me
to keep my code clear.

If an enhancement is made in this area, I would like have something
like:

"loop"
"continue"
"iterate"
"next"

to jump to the next iteration of a loop without having to go through the
rest of the code before getting to the end of the loop.

For example,

for i = 1 to 1000 do
 if s[i] is not what I am looking for then
  loop
 end if

 Many lines of code that do not lend themselves to a simple structure
such as if structure (like shown in my example).
 --(It is most useful when I want to loop somewhere in the middle of
some nested structures of code.)
 ...
end for

--
Terry Constant
mailto:constant at flash.net
http://flash.net/~constant

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu