Sign in to follow this  
Followers 0
herworth

Function Parameter

3 posts in this topic

Can you set a default parameter in a function the way you can VBA eg

Func Myfunc($x)
If $x is missing then $x = y
more code ...
endfunc

I can't see anything so I assume not. Just thought I'd ask tho'.

:D


[u][font="Arial"]Pete[/font][/u]

Share this post


Link to post
Share on other sites



Func Myfunc($x)
If IsDeclared ("x") then $x = "y"
;or
If IsDeclared ("x") then $x = $y
;or
If $x="" then $x = $y
;more code ...
endfunc

no is missing in autoit, and you cant call out just y, it needs to be "Y" or $y.


AutoIt3, the MACGYVER Pocket Knife for computers.

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