Re: Hi

new topic     » goto parent     » topic index » view thread      » older message » newer message

At 07:46 p.m. 16-01-99 -0500, you wrote:
>Thanks for the message,
>
>Um, about using the return statment, could I write a procedure and simply put
>return( ) on the last line before end procedure and this would return the
program
>to the if-then or whatever else that had called it?

As I explained before the return statement (without the parenthesis) can be
used to exit the procedure before it reaches the "end procedure".
Example:

procedure ImOldEnough(integer age)
        if age > 18 then
                puts(1, "You are old enough")
                return
        end if
        puts(1, "You are not old enough")
end procedure

The example is very trivial, but shows the point. Instead of using the
return statement I would used an "else" for better readability.


Regards,
        Daniel   Berstein
        daber at pair.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu