Sign in to follow this  
Followers 0
-TS-

whats the func command?

4 posts in this topic

whats the func command setup?

with the goto command i would be long done and already had it posted on my site by now, but im stuck asking questions

*TS*

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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!

Share this post


Link to post
Share on other sites

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

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

Share this post


Link to post
Share on other sites

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

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  
Followers 0