Jump to content
Sign in to follow this  
darkshark

What's the use the "Return"?

Recommended Posts

darkshark

Hi guys, can you get me a question, please?

I'm using autoit for a while, until I turn around and inside of my needs ....

But a function that until now I did not understand what's the use, and I've seen several people using in their code is the function "return"

Someone may say to me what exactly does it do?

It may be useful to me!

Thanks

Share this post


Link to post
Share on other sites
PhilHibbs

The "Return" statement is used to exit from a function, and can also set the value that the function gives to the caller.

$value = MyValue()
MsgBox(0,"Value",$value)

Func MyValue()
  Return "This is what the function returns"
EndFunc

Share this post


Link to post
Share on other sites
darkshark

The "Return" statement is used to exit from a function, and can also set the value that the function gives to the caller.

$value = MyValue()
MsgBox(0,"Value",$value)

Func MyValue()
  Return "This is what the function returns"
EndFunc

I got it!

Thank you very much

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.