Jump to content

whats the func command?


Recommended Posts

Func functioname([byRef] $param1, [byRef] $paramN)

; code goes here

[Return x]

EndFunc

; 
; *** AN EXAMPLE SCRIPT TO DEMONSTRATE FUNCTIONS ***

beginningThing()

$var = 7
MsgBox(0,"VAR equals", $var)

Decrement($var)
MsgBox(0,"After decrement, var now equals", $var)

MsgBox(0,"VAR tripled is", triple($var))
MsgBox(0,"but VAR still equals", $var)

theEnd("Done", "That's all folks")

Exit

; Example of function
Func triple ($num)
    Return $num * 3
EndFunc

; Example of ByRef
Func Decrement (ByRef $x)
    $x = $x - 1
    Return $x
EndFunc

; Example of no return value and also multiple parameters
Func theEnd ($title, $text)
    MsgBox(0,$title, $text)
EndFunc

; Example of no return value or parameters
Func beginningThing()
    MsgBox(0,"","Examples of Functions")
EndFunc
Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to post
Share on other sites
  • 5 years later...

ohh..its a very complicated functon..thanks ... its useful for me

Webluxor.com web luxor (860)-865-0246

Whats complicated?

$result = Multiply(2,3)
MsgBox(0,"",$result);Shows 6

Func Multiply($num1, $num2)
Return $num1 * $num2
EndFunc
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...