1. exit procedure?

Hello,

I have looked through the documentation and can't find an "exit procedure" /
"exit function" statement. I'm sure it doesn't exist, but thought I'd check
with the experts!!!.

What I'm looking for is a statement that exits the current procedure.
e.g

procedure process()

if {some condition} then
   exit procedure
end if

... continue processing

end procedure


Would anyone else like it to be implemented in Euphoria?

Regards,

Ray Smith

new topic     » topic index » view message » categorize

2. Re: exit procedure?

I think if you just use 'return' it should get you outta there.

-----Original Message-----
From: Smith Ray <Ray.Smith at FUJITSU.COM.AU>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: Monday, February 22, 1999 4:38 PM
Subject: exit procedure?


>Hello,
>
>I have looked through the documentation and can't find an "exit procedure"
;
>"exit function" statement. I'm sure it doesn't exist, but thought I'd check
>with the experts!!!.
>
>What I'm looking for is a statement that exits the current procedure.
>e.g
>
>procedure process()
>
>if {some condition} then
>   exit procedure
>end if
>
>... continue processing
>
>end procedure
>
>
>Would anyone else like it to be implemented in Euphoria?
>
>Regards,
>
>Ray Smith
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: exit procedure?

At 08:42 PM 22-02-1999 , you wrote:
>Hello,
>
>I have looked through the documentation and can't find an "exit procedure" /
>"exit function" statement. I'm sure it doesn't exist, but thought I'd check
>with the experts!!!.
>
>What I'm looking for is a statement that exits the current procedure.
>e.g
>
>procedure process()
>
>if {some condition} then
>   exit procedure
>end if
>
>... continue processing
>
>end procedure

Use the return statement

procedure a()
        if condition then
                return
        end if
end procedure

function b()
        if condition then
                return some_value
        end if
end function

The return statement can be used on procedures given that you don't return
a value. Functions are exactly the opposite, you must return a value.


Regards,
         Daniel  Berstein
         [daber at pair.com]

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu