Jump to content

Need Help with Global Variable


Recommended Posts

Is there a way to do this? I call on the values in multiple Functions!

CODE
Global $1add = GUICtrlRead($txt1Add)

Global $1city = GUICtrlRead($txt1city)

Global $1state = GUICtrlRead($txt1state)

Global $2add = GUICtrlRead($txt2Add)

Global $2city = GUICtrlRead($txt2city)

Global $2state = GUICtrlRead($txt2state)

Global $3add = GUICtrlRead($txt3Add)

Global $3city = GUICtrlRead($txt3city)

Global $3state = GUICtrlRead($txt3state)

Global $4add = GUICtrlRead($txt4Add)

Global $4city = GUICtrlRead($txt4city)

Global $4state = GUICtrlRead($txt4state)

Global $5add = GUICtrlRead($txt5Add)

Global $5city = GUICtrlRead($txt5city)

Global $5state = GUICtrlRead($txt5state)

Global $6add = GUICtrlRead($txt6Add)

Global $6city = GUICtrlRead($txt6city)

Global $6state = GUICtrlRead($txt6state)

Global $7add = GUICtrlRead($txt7Add)

Global $7city = GUICtrlRead($txt7city)

Global $7state = GUICtrlRead($txt7state)

Global $8add = GUICtrlRead($txt8Add)

Global $8city = GUICtrlRead($txt8city)

Global $8state = GUICtrlRead($txt8state)

Global $9add = GUICtrlRead($txt9Add)

Global $9city = GUICtrlRead($txt9city)

Global $9state = GUICtrlRead($txt9state)

[topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner!
Link to comment
Share on other sites

Like this...

Global $add[10], $city[10], $state[10]
Global $txtadd[10], $txtcity[10], $txtstate[10]


;Create the controls
 $txtadd[1] = GUICtrl....

;Read the controls
For $x = 1 To UBound($state) - 1
    $add[$x] = GUICtrlRead($txtadd[$x])
    $city[$x] = GUICtrlRead($txtcity[$x])
    $state[$x] = GUICtrlRead($txtstate[$x])
Next

8)

Is there a way to do it without adding GUICtrlRead into the function?
[topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner!
Link to comment
Share on other sites

Yes!!..??? ...What do you want to do?

8)

Thanks Valuater!

After figuring out how I use what you posted. I learned all I had to do was add them to the While 1.

Thanks again and sorry! I don't know why I didn't see that before.

PS. Your way is MUCH cleaner!

[topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner!
Link to comment
Share on other sites

Thanks Valuater!

After figuring out how I use what you posted. I learned all I had to do was add them to the While 1.

Thanks again and sorry! I don't know why I didn't see that before.

PS. Your way is MUCH cleaner!

Welcome!!

... Glad it helped!

8)

NEWHeader1.png

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