Jump to content
Sign in to follow this  
Quinch

Return check

Recommended Posts

Quinch

Just for a quick check about how the Return command works - does it terminate the function as soon as it's called {returning given value in the process}, or do and additional commands after it continue to execute until EndFunc is reached? It seems to be the former, but it's best to confirm.

Share this post


Link to post
Share on other sites
DaRam

Former. To clarify the first return in the function encountered depending on the code.

You could have multiple return statements that are condition based:

If SomeCondition Then
   Return 1
Else
  Return 0
EndIf

Just for a quick check about how the Return command works - does it terminate the function as soon as it's called {returning given value in the process}, or do and additional commands after it continue to execute until EndFunc is reached? It seems to be the former, but it's best to confirm.

Share this post


Link to post
Share on other sites
DjDeep00

From the Help File...

Use the Return keyword to exit the function. Unlike built-in functions, user-defined functions return 0 unless another return value is specified.

:P

Share this post


Link to post
Share on other sites
Quinch

From the Help File...

:P

Heh, thanks for the confirmation. I tried looking up the Help file, but put "return" in the search and see what you get...

Share this post


Link to post
Share on other sites
DjDeep00

Heh, thanks for the confirmation. I tried looking up the Help file, but put "return" in the search and see what you get...

Look it up by keyword (Index).

:P

Edited by DjDeep00

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.