Jump to content

Changing Function's Actions


Recommended Posts

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
Link to comment
Share on other sites

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.

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