Jump to content

Function Parameter


Recommended Posts

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]
Link to comment
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.

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...