Sign in to follow this  
Followers 0
gcue

guictrlread($var) and global

7 posts in this topic

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

hmm i did do a guictrlread before deleting the gui

Share this post


Link to post
Share on other sites

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.

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

there ya go!

thanks!

Share this post


Link to post
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
Sign in to follow this  
Followers 0