Jump to content

Recommended Posts

Posted

i think thats the problem...

the error i get is "Incorrect number of parameters in function call"

the code is:

if IsDeclared ( Eval ($x[$x[0]])) = 0 then Assign ( $x[$x[0]]), "a")

Posted

if IsDeclared ( Eval ($x[$x[0]])) = 0 then Assign ( $x[$x[0]]), "a")

should be...

if IsDeclared ( Eval ($x[$x[0]])) = 0 then Assign ( $x[$x[0]], "a")
Posted

after

if IsDeclared ( Eval ($x[$x[0]])) = 0 then Assign ( $x[$x[0]], "a")

i call a function and i want it to take the variable i made there so i use

Eval ($x[$x[0]])

as the parameter i send and in the function i take it ByRef when i did that it gave me an error:

"Expected a variable in user function call."

why is that? there should be a variable already...

Posted

IsDeclared requires the NAME of the variable to be quoted in the function:

$x = 4
msgbox(0, "", IsDeclared("x")

Notice no $x in the function, but instead just x in quotes. For your particular problem, therefore, it will not work because you have an array.

Who else would I be?
Posted (edited)

after

if IsDeclared ( Eval ($x[$x[0]])) = 0 then Assign ( $x[$x[0]], "a")

i call a function and i want it to take the variable i made there so i use

Eval ($x[$x[0]])

as the parameter i send and in the function i take it ByRef when i did that it gave me an error:

"Expected a variable in user function call."

why is that? there should be a variable already...

<{POST_SNAPBACK}>

What did you call the variable?

You have to use a real variable in the header of the function.

Example:

Func TestFunc($a, $b)
If $a <> "" AND $b <> "" Then
  ;Do stuff
EndIf
EndFunc

I don't understand exactly how ByRef works, so I can't help you with that.

Edited by SlimShady
Posted (edited)

... me too i dont know what byref can change in the fact that it worked before i putted it on byref

and i did use it like in your example...

Edited by magaf
Posted

ive had to use another way less efficient way to make my program work

but still from what ive seen, with autoit its impossible to use a variable as an array's name...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...