Jump to content
Sign in to follow this  
gcue

guictrlread($var) and global

Recommended Posts

gcue

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
Jos

$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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
gcue

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
gcue

hmm i did do a guictrlread before deleting the gui

Share this post


Link to post
Share on other sites
Jos

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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.