Jump to content

what is return in autoit ?


Recommended Posts

Posted (edited)

...moreover, a Function, plays a function that in turn can Return a value.
Forget programming until you can get some reading comprehension as otherwise you would not know what is been presented in front of your eyes.

Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Posted (edited)

Return statement is used to exit from the current subroutine and resume at the point in the script  immediately after the instruction which called the subroutine, known as its return address.

Consider the following mathematical expression.
2 + 2 = 4

Expression breakdown

2 augend
+ addition operator
2 addend
= equality sign
4 sum


The following AutoIt script will add two integers, numbers together and returns the sum.

Global $iSum

Func _Calculate($iAugend, $iAddend)
    Return $iAugend + $iAddend
EndFunc

$iSum = _Calculate(2, 2) ; calling instruction, return address

MsgBox(0, "Sum", "The sum of 2 + 2 = " & $iSum)

 

Edited by AndrewG
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...