Jump to content
Sign in to follow this  
brett

Changing Function's Actions

Recommended Posts

brett

How would i make one function, for example Read(), but make that one find the response in an Instant Message, but if i call the function using Read(Command), it'll send it to the command run function, but if i call the function using Read(Path) It'll do the same actions but send the variable it creates to a different function based on the parameter.

Does anybody get this? it seems confusing.


-Brett

Share this post


Link to post
Share on other sites
scriptkitty

UDF do not have optional parts though, so you can't call a function:

Read() ; as in blank

Read("Command")

Read("path")

you would have to call it like:

Read("")

Read("Command")

Read("path")

hope that wasn't confusing.

If a UDF is set up for 3 parameters, you need to use all 3 even if they are blank.

$year="2004"
three("Hi",$year,"")
; three("Hi",$year); this would error
; three() ; this will error

func three($x,$y,$z)
; code
endfunc

Error would be: Incorrect number of parameters in function call.


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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.