Jump to content

guictrlread($var) and global


Recommended Posts

theres a userinput created $var from a child popup window

after i delete the gui child i cant get to that var

i tried setting it global

Global $location=GUICtrlCreateInput("",10,10,220,25, $ES_UPPERCASE);10

i also have Global $location up at top

but it doesnt carry over to later functions

how can i carry it over?

Link to comment
Share on other sites

  • Developers

$Location contains the Handle to the Control which obviously will be gone after you Delete the GUI.

Just do a GUICtrlRead() to retrieve the value before deleting the GUI.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

it doesnt carry over.. what am i doing wrong?

$location_child=GUICreate("Enter Location Name:", 400,80, -1, -1, $WS_EX_MDICHILD)
$location=GUICtrlCreateInput("",10,10,220,25, $ES_UPPERCASE);10

$OK_btn = GUICtrlCreateButton ("OK", 245,13,40,20,0x0300);13
GUICtrlSetOnEvent($OK_btn, "Location_Check")
......
EndFunc

Func Location_Check()
msgbox(0,"",Guictrlread($location))   <==== still readable
guictrlread($location)
GUIDelete($location_child)
Find_IP ()
EndFunc

Func Find_IP()
msgbox(0,"",Guictrlread($location)) <===== no longer readable
EndFunc
Edited by gcue
Link to comment
Share on other sites

  • Developers

hmm i did do a guictrlread before deleting the gui

I saw that, but you need to save the result of the GUICtrlRead() in A global variable and use that.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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