Jump to content

Checkbox and Array problem


LMTA
 Share

Recommended Posts

Because your saving the Gui result into a local (to function) variable.

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

... or ByRef it.

see Posted Image on functions. (and variable declaration and variable scope, dim, local, global)

Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

@ZacUSNYR and @MvGulik: Thanks for the suggestions, I will give it a try!

I have declared the $Map1, 2, 3 and 4 values globally, therefore I was expecting that these global variables would be updated.

BTW: I do read the manual before I put a question here. However, it's not always clear for a noob as myself why things sometimes do not work as I expect them to...

Edited by LMTA
Link to comment
Share on other sites

BTW: I do read the manual before I put a question here. However, it's not always clear for a noob as myself why things sometimes do not work as I expect them to...

No shame in quoting a part of the help file that seems unclear, and if needed specifying what it is you think it means or showing some code that is not doing what you think it should be doing. Great way to get some additional information. And maybe even some example codes that shows how it works and what the pitfalls might be.

:x

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

No shame in quoting a part of the help file that seems unclear, and if needed specifying what it is you think it means or showing some code that is not doing what you think it should be doing. Great way to get some additional information. And maybe even some example codes that shows how it works and what the pitfalls might be.

Okay, here's an excerpt from the helpfile:

Func functioname ( [Const] [byRef] $param1, ..., [Const] [byRef] $paramN, $optionalpar1 = value, ...)

...

[Return [value]]

EndFunc

What I don't get from the manual, is how to implement the ByRef feature in the GUI part of my code. I also don't actually understand why the ByRef feature would help me in this case: I am already declaring the values globally, right? If I adapt the code for the GUI function with the ByRef:

Func InstellingenMenu(Byref $Map1, Byref $Map2, Byref $Map3, Byref $Map4)
When running the script generates errors, like:

ElmoReader.au3(150,74) : ERROR: InstellingenMenu() called by a previous line with 0 arg(s). Min = 4. First previous line calling this Func is 74.

Func InstellingenMenu(Byref $Map1, Byref $Map2, Byref $Map3, Byref $Map4)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

ElmoReader.au3(150,74) : ERROR: InstellingenMenu() previously called with Const or expression on ByRef param(s).

Func InstellingenMenu(Byref $Map1, Byref $Map2, Byref $Map3, Byref $Map4)

ElmoReader.au3(150,74) : ERROR: InstellingenMenu() called by a previous line with 0 arg(s). Min = 4. First previous line calling this Func is 54.

Func InstellingenMenu(Byref $Map1, Byref $Map2, Byref $Map3, Byref $Map4)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

ElmoReader.au3(150,74) : ERROR: InstellingenMenu() previously called with Const or expression on ByRef param(s).

Func InstellingenMenu(Byref $Map1, Byref $Map2, Byref $Map3, Byref $Map4)

Some suggestions what I am (obviously) doing wrong? I still am in the assumption those variables are globally being set and read, but it does not work as I am expecting.
Link to comment
Share on other sites

nevermind.

Edited by iEvKI3gv9Wrkd41u

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

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