VerteXslaPPy Posted June 6, 2015 Posted June 6, 2015 Hello all today i want to ask you if it possible when i for example set in the first programm variable $test1 = hellothe programms close but the variable saved and can i then open a new autoit script who show me then the variable $test1? example :$hInput_username = GUICtrlCreateInput("", 70, 12, 137, 21) ; ($hInput_username is for example = Maik) then close the script/programm now open the next programm and load the variable from the cache / ram GUICtrlCreateLabel("hello welcome back " & $$hInput_username , 12, 14, 84, 17) ;(the label have the text : hello welcome back Maik) if this possible? thanks in advance
kaisies Posted June 6, 2015 Posted June 6, 2015 Sure, look at writing to a text file, or ini, depending on what suits your needs.
SadBunny Posted June 6, 2015 Posted June 6, 2015 Data stored in the local memory of the AutoIt script will be gone when you start your next script. So, cache/ram: no. But if you want to do it without file interaction, you could write something like an environment variable or a registry entry. VerteXslaPPy 1 Roses are FF0000, violets are 0000FF... All my base are belong to you.
argumentum Posted June 6, 2015 Posted June 6, 2015 #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Local $Form1 = GUICreate("Form1", 327, 95, 192, 124) Local $hInput_username = GUICtrlCreateInput(magicRead("hInput_username"), 16, 16, 121, 21) Local $hLabel_username = GUICtrlCreateLabel("hello welcome back " & magicRead("hInput_username"), 16, 56, 221, 21) ;(the label have the text : hello welcome back Maik) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE magicWrite("hInput_username") GUIDelete() ExitLoop EndSwitch WEnd Func magicWrite($sGuiName) IniWrite(StringTrimRight(@ScriptFullPath, 3) & "ini", "saved", $sGuiName, GUICtrlRead(Eval($sGuiName))) EndFunc ;==>magicWrite Func magicRead($sGuiName) Return IniRead(StringTrimRight(@ScriptFullPath, 3) & "ini", "saved", $sGuiName, "no one ?") EndFunc ;==>magicRead VerteXslaPPy 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now