
Wader
Members-
Posts
19 -
Joined
-
Last visited
Everything posted by Wader
-
I'm trying to use the XMLDOMWrapper to read multiple values from an XML file and can't get it to work. I keep getting "Error in expression" Any ideas where I am going wrong? Here is my code: #include <File.au3>; File functions #include <Array.au3>; Array functions #include <_XMLDomWrapper.au3>;_XML Management functions $loadXML = _XMLLoadXML("Response.xml") $Node1= "/qdbapi/table/records/record/@id" $Node1retval = _XMLGetValue($Node1) _ArrayDisplay($Node1retval) MsgBox(0,0,$Node1retval) Here is my XML: <?xml version="1.0" ?> - <qdbapi> - <table> - <records> - <record> <f id="3">1</f> <f id="16">2</f> <f id="17">test</f> </record> </records> </table> </qdbapi>
-
Do you have an example of the _WIM_ApplyImage() function. The code documentation seems to be a copy of the capture function.
-
Has anyone came up with a way to verify that the network cable is plugged in? When I use PING to check an IP Address it works great if I have a valid IP Address. If I unplug my network cable and disable wireless though it returns a false positive.
-
Has anyone found a way around this example and the use of 'Ping' returning a false positive if an IP address doesn't exist? For example, if you unplug the network cable and disable wireless and run the code it always returns a 'Success'. This code is great if the network cable is plugged in, but what if are trying to verify that the cable is plugged in by performing a PING of an address? Is there a better way than this?
-
Need help with CASE getting out of control
Wader replied to Wader's topic in AutoIt General Help and Support
Thanks again. I cleaned up my script on my end now. I always forget to do that. -
Need help with CASE getting out of control
Wader replied to Wader's topic in AutoIt General Help and Support
Valuater - Your post actually made it clear. The below code is now working with a modification to the Case Statement. I really appreciate it! #include <array.au3> Dim $GUI_DOCKHEIGHT, $GUI_DOCKWIDTH, $GUI_EVENT_CLOSE, $Label1, $Label2, $Manual, $GUI Dim $Application1, $Application2, $Application3, $Application4, $Application5, $Application6, $Application7, $Application8, $Application9, $Application10 Dim $ManualAutoInstall, $ManualAutoInstall1, $ManualAutoInstall2, $ManualAutoInstall3, $ManualAutoInstall4, $ManualAutoInstall5, $ManualAutoInstall6, $ManualAutoInstall7, $ManualAutoInstall8, $ManualAutoInstall9, $ManualAutoInstall10 Dim $AutoAutoInstall, $AutoAutoInstall1, $AutoAutoInstall2,$AutoAutoInstall3,$AutoAutoInstall4, $AutoAutoInstall5, $AutoAutoInstall6, $AutoAutoInstall7, $AutoAutoInstall8, $AutoAutoInstall9, $AutoAutoInstall10 Dim $AppButtons, $CaseNumber $AppInstall = GUICreate(IniRead("applicationstest.ini","GUIConfig","GuiTitle",""), IniRead("applicationstest.ini","GUIConfig","GuiWidth",""), IniRead("applicationstest.ini","GUIConfig","GuiHeight",""), IniRead("applicationstest.ini","GUIConfig","GUILeft",""), IniRead("applicationstest.ini","GUIConfig","GUITop","")) $Auto = GUICtrlCreateTab(IniRead("applicationstest.ini","GUIConfig","TabLeft",""), IniRead("applicationstest.ini","GUIConfig","TabTop",""), IniRead("applicationstest.ini","GUIConfig","TabWidth",""), IniRead("applicationstest.ini","GUIConfig","TabHeight","")) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) #Region Tab1 - Auto Apps $Auto = GUICtrlCreateTabItem("Auto") $AutoAppList = IniReadSectionNames("applicationstest.ini") Global $avArray[1000][1000] $RadioHeight = 150 For $i = 1 to $AutoAppList[0] $ApplicationName = IniRead("applicationstest.ini",$AutoAppList[$i],"Name","") $ApplicationDistribMode = IniRead("applicationstest.ini",$AutoAppList[$i],"DistributionMode","") $ApplicationInstallScript = IniRead("applicationstest.ini",$AutoAppList[$i],"InstallScript","") $avArray[$i][0] = $AutoAppList[$i] $avArray[$i][1] = $ApplicationInstallScript If $ApplicationDistribMode = "Auto" Then $AutoAppListName = GUICtrlCreateLabel($ApplicationName, 30, $RadioHeight, 140, 17) If $ApplicationDistribMode = "Auto" AND $ApplicationInstallScript <> "" Then $avArray[$i][0] = GUICtrlCreateButton("Auto Install", 245, $RadioHeight, 75, 17) If $ApplicationDistribMode = "Auto" Then $RadioHeight = $RadioHeight + 20 Next $AutoQUITTop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $AutoUPDATETop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $AutoUpdateINI = GUICtrlCreateButton("UPDATE", 375, $AutoUPDATETop, 100, 25) $AutoQuit = GUICtrlCreateButton("QUIT", 485, $AutoQUITTop, 100, 25) #EndRegion #Region Tab2 - Manual Apps $Manual = GUICtrlCreateTabItem("Manual") $ManualAppList = IniReadSectionNames("applicationstest.ini") $RadioHeight = 150 For $j = 2 to $ManualAppList[0] $AppID = $j $ApplicationName = IniRead("applicationstest.ini",$ManualAppList[$j],"Name","") $ApplicationDistribMode = IniRead("applicationstest.ini",$ManualAppList[$j],"DistributionMode","") $ApplicationInstallScript = IniRead("applicationstest.ini",$ManualAppList[$j],"InstallScript","") $avArray[$i][0] = $ManualAppList[$j] $avArray[$i][1] = $ApplicationInstallScript If $ApplicationDistribMode = "Manual" Then $ManualAppList[$j] = GUICtrlCreateLabel($ApplicationName, 30, $RadioHeight, 140, 17) If $ApplicationDistribMode = "Manual" AND $ApplicationInstallScript <> "" Then $avArray[$j][0] = GUICtrlCreateButton("AutoInstall", 245, $RadioHeight, 75, 17) If $ApplicationDistribMode = "Manual" Then $RadioHeight = $RadioHeight + 20 $ManualAutoInstall = $ManualAutoInstall & $AppID Next $ManualQUITTop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $ManualUPDATETop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $ManualUpdateINI = GUICtrlCreateButton("UPDATE", 375, $ManualUPDATETop, 100, 25) $ManualQuit = GUICtrlCreateButton("QUIT", 485, $ManualQUITTop, 100, 25) #EndRegion GUICtrlCreateTabItem("") $Header = GUICtrlCreateLabel(IniRead("applicationstest.ini","GUIConfig","Title",""), IniRead("applicationstest.ini","GUIConfig","TitleLeft",""), IniRead("applicationstest.ini","GUIConfig","TitleDown",""), IniRead("applicationstest.ini","GUIConfig","TitleWidth",""), IniRead("applicationstest.ini","GUIConfig","TitleHeight","")) GUICtrlSetFont(-1, 20, 800, 0, "Arial Black") $Intro = GUICtrlCreateLabel(IniRead("applicationstest.ini","GUIConfig","Info",""), 20, 56, 600, 55) GUISetState(@SW_SHOW) While $GUI <> "QUIT" $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Case $AutoQuit Exit Case $ManualQuit Exit Case $AutoUpdateINI msgbox(4096,"Hold on!", "Not done yet") Case $ManualUpdateINI msgbox(4096,"Hold on!", "Not done yet") Case $avArray[1][0] to UBound($avArray) For $i = 1 to UBound($avArray) -1 If $nMsg = $avArray[$i][0] Then $CaseNumber = $i _TestFunction($i) EndIf Next EndSwitch WEnd Func _TestFunction($CaseNumber) $i = $CaseNumber msgbox(0,"App " & $CaseNumber, "Application " & $AutoAppList[$i] & ' Install Script "' & $avArray[$i][1] & '" goes here') $CaseNumber = 0 EndFunc -
Need help with CASE getting out of control
Wader replied to Wader's topic in AutoIt General Help and Support
I tried it out and it didn't work. Nothing happens at all when I click the buttons now. Appreciate the suggestion though. I am willing to try anything. -
I am working on a project that will dyanmically create buttons. That process is working now thanks to help from this board. My issue now is that I don't want to create Case statement for all possible buttons created like in the below example. Is there a way to get around this? #include <array.au3> Dim $GUI_DOCKHEIGHT, $GUI_DOCKWIDTH, $GUI_EVENT_CLOSE, $Label1, $Label2, $Manual, $GUI Dim $Application1, $Application2, $Application3, $Application4, $Application5, $Application6, $Application7, $Application8, $Application9, $Application10 Dim $ManualAutoInstall, $ManualAutoInstall1, $ManualAutoInstall2, $ManualAutoInstall3, $ManualAutoInstall4, $ManualAutoInstall5, $ManualAutoInstall6, $ManualAutoInstall7, $ManualAutoInstall8, $ManualAutoInstall9, $ManualAutoInstall10 Dim $AutoAutoInstall, $AutoAutoInstall1, $AutoAutoInstall2,$AutoAutoInstall3,$AutoAutoInstall4, $AutoAutoInstall5, $AutoAutoInstall6, $AutoAutoInstall7, $AutoAutoInstall8, $AutoAutoInstall9, $AutoAutoInstall10 Dim $AppButtons, $CaseNumber msgbox(0,"Case Number", $CaseNumber) $AppInstall = GUICreate(IniRead("applicationstest.ini","GUIConfig","GuiTitle",""), IniRead("applicationstest.ini","GUIConfig","GuiWidth",""), IniRead("applicationstest.ini","GUIConfig","GuiHeight",""), IniRead("applicationstest.ini","GUIConfig","GUILeft",""), IniRead("applicationstest.ini","GUIConfig","GUITop","")) $Auto = GUICtrlCreateTab(IniRead("applicationstest.ini","GUIConfig","TabLeft",""), IniRead("applicationstest.ini","GUIConfig","TabTop",""), IniRead("applicationstest.ini","GUIConfig","TabWidth",""), IniRead("applicationstest.ini","GUIConfig","TabHeight","")) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) #Region Tab1 - Auto Apps $Auto = GUICtrlCreateTabItem("Auto") $AutoAppList = IniReadSectionNames("applicationstest.ini") Global $avArray[1000][1000] $RadioHeight = 150 For $i = 1 to $AutoAppList[0] $ApplicationName = IniRead("applicationstest.ini",$AutoAppList[$i],"Name","") $ApplicationDistribMode = IniRead("applicationstest.ini",$AutoAppList[$i],"DistributionMode","") $ApplicationInstallScript = IniRead("applicationstest.ini",$AutoAppList[$i],"InstallScript","") $avArray[$i][0] = $AutoAppList[$i] $avArray[$i][1] = $ApplicationInstallScript If $ApplicationDistribMode = "Auto" Then $AutoAppListName = GUICtrlCreateLabel($ApplicationName, 30, $RadioHeight, 140, 17) If $ApplicationDistribMode = "Auto" AND $ApplicationInstallScript <> "" Then $avArray[$i][0] = GUICtrlCreateButton("Auto Install", 245, $RadioHeight, 75, 17) If $ApplicationDistribMode = "Auto" Then $RadioHeight = $RadioHeight + 20 Next $AutoQUITTop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $AutoUPDATETop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $AutoUpdateINI = GUICtrlCreateButton("UPDATE", 375, $AutoUPDATETop, 100, 25) $AutoQuit = GUICtrlCreateButton("QUIT", 485, $AutoQUITTop, 100, 25) #EndRegion #Region Tab2 - Manual Apps $Manual = GUICtrlCreateTabItem("Manual") $ManualAppList = IniReadSectionNames("applicationstest.ini") $RadioHeight = 150 For $j = 2 to $ManualAppList[0] $AppID = $j $ApplicationName = IniRead("applicationstest.ini",$ManualAppList[$j],"Name","") $ApplicationDistribMode = IniRead("applicationstest.ini",$ManualAppList[$j],"DistributionMode","") $ApplicationInstallScript = IniRead("applicationstest.ini",$ManualAppList[$j],"InstallScript","") $avArray[$i][0] = $ManualAppList[$j] $avArray[$i][1] = $ApplicationInstallScript If $ApplicationDistribMode = "Manual" Then $ManualAppList[$j] = GUICtrlCreateLabel($ApplicationName, 30, $RadioHeight, 140, 17) If $ApplicationDistribMode = "Manual" AND $ApplicationInstallScript <> "" Then $avArray[$j][0] = GUICtrlCreateButton("AutoInstall", 245, $RadioHeight, 75, 17) If $ApplicationDistribMode = "Manual" Then $RadioHeight = $RadioHeight + 20 $ManualAutoInstall = $ManualAutoInstall & $AppID Next $ManualQUITTop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $ManualUPDATETop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $ManualUpdateINI = GUICtrlCreateButton("UPDATE", 375, $ManualUPDATETop, 100, 25) $ManualQuit = GUICtrlCreateButton("QUIT", 485, $ManualQUITTop, 100, 25) #EndRegion GUICtrlCreateTabItem("") $Header = GUICtrlCreateLabel(IniRead("applicationstest.ini","GUIConfig","Title",""), IniRead("applicationstest.ini","GUIConfig","TitleLeft",""), IniRead("applicationstest.ini","GUIConfig","TitleDown",""), IniRead("applicationstest.ini","GUIConfig","TitleWidth",""), IniRead("applicationstest.ini","GUIConfig","TitleHeight","")) GUICtrlSetFont(-1, 20, 800, 0, "Arial Black") $Intro = GUICtrlCreateLabel(IniRead("applicationstest.ini","GUIConfig","Info",""), 20, 56, 600, 55) GUISetState(@SW_SHOW) While $GUI <> "QUIT" $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Case $AutoQuit Exit Case $ManualQuit Exit Case $AutoUpdateINI msgbox(4096,"Hold on!", "Not done yet") Case $ManualUpdateINI msgbox(4096,"Hold on!", "Not done yet") Case $avArray[1][0] $CaseNumber = "1" _TestFunction($CaseNumber) Case $avArray[2][0] $CaseNumber = "2" _TestFunction($CaseNumber) Case $avArray[3][0] $CaseNumber = "3" _TestFunction($CaseNumber) Case $avArray[4][0] $CaseNumber = "4" _TestFunction($CaseNumber) Case $avArray[5][0] $CaseNumber = "5" _TestFunction($CaseNumber) Case $avArray[6][0] $CaseNumber = "6" _TestFunction($CaseNumber) Case $avArray[7][0] $CaseNumber = "7" _TestFunction($CaseNumber) Case $avArray[8][0] $CaseNumber = "8" _TestFunction($CaseNumber) Case $avArray[9][0] $CaseNumber = "9" _TestFunction($CaseNumber) Case $avArray[10][0] $CaseNumber = "10" _TestFunction($CaseNumber) Case $avArray[11][0] $CaseNumber = "11" _TestFunction($CaseNumber) Case $avArray[12][0] $CaseNumber = "12" _TestFunction($CaseNumber) Case $avArray[13][0] $CaseNumber = "13" _TestFunction($CaseNumber) EndSwitch WEnd Func _TestFunction($CaseNumber) $i = $CaseNumber msgbox(0,"App " & $CaseNumber, "Application " & $AutoAppList[$i] & ' Install Script "' & $avArray[$i][1] & '" goes here') $CaseNumber = 0 EndFunc
-
Can I Dynamically Create Variable Names?
Wader replied to Wader's topic in AutoIt General Help and Support
Guys - This is what I came up with off of your suggestions. It is working now! I really appreciate the help. include <array.au3> Dim $GUI_DOCKHEIGHT, $GUI_DOCKWIDTH, $GUI_EVENT_CLOSE, $Label1, $Label2, $Manual, $GUI Dim $Application1, $Application2, $Application3, $Application4, $Application5, $Application6, $Application7, $Application8, $Application9, $Application10 Dim $ManualAutoInstall, $ManualAutoInstall1, $ManualAutoInstall2, $ManualAutoInstall3, $ManualAutoInstall4, $ManualAutoInstall5, $ManualAutoInstall6, $ManualAutoInstall7, $ManualAutoInstall8, $ManualAutoInstall9, $ManualAutoInstall10 Dim $AutoAutoInstall, $AutoAutoInstall1, $AutoAutoInstall2,$AutoAutoInstall3,$AutoAutoInstall4, $AutoAutoInstall5, $AutoAutoInstall6, $AutoAutoInstall7, $AutoAutoInstall8, $AutoAutoInstall9, $AutoAutoInstall10 Dim $AppButtons ;~ Local $AppButtons[10][10] ;~ $AppButtons[0][1] = "test" #Region ### START Koda GUI section ### Form= $AppInstall = GUICreate(IniRead("applicationstest.ini","GUIConfig","GuiTitle",""), IniRead("applicationstest.ini","GUIConfig","GuiWidth",""), IniRead("applicationstest.ini","GUIConfig","GuiHeight",""), IniRead("applicationstest.ini","GUIConfig","GUILeft",""), IniRead("applicationstest.ini","GUIConfig","GUITop","")) $Auto = GUICtrlCreateTab(IniRead("applicationstest.ini","GUIConfig","TabLeft",""), IniRead("applicationstest.ini","GUIConfig","TabTop",""), IniRead("applicationstest.ini","GUIConfig","TabWidth",""), IniRead("applicationstest.ini","GUIConfig","TabHeight","")) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) #Region Tab1 - Auto Apps $Auto = GUICtrlCreateTabItem("Auto") $AutoAppList = IniReadSectionNames("applicationstest.ini") Global $avArray[1000][1000] $RadioHeight = 150 For $i = 2 to $AutoAppList[0] $ApplicationName = IniRead("applicationstest.ini",$AutoAppList[$i],"Name","") $ApplicationDistribMode = IniRead("applicationstest.ini",$AutoAppList[$i],"DistributionMode","") $ApplicationInstallScript = IniRead("applicationstest.ini",$AutoAppList[$i],"InstallScript","") $avArray[$i][0] = $AutoAppList[$i] If $ApplicationDistribMode = "Auto" Then $AutoAppListName = GUICtrlCreateLabel($ApplicationName, 30, $RadioHeight, 140, 17) If $ApplicationDistribMode = "Auto" AND $ApplicationInstallScript <> "" Then $avArray[$i][0] = GUICtrlCreateButton("Auto Install", 245, $RadioHeight, 75, 17) ;~ msgbox(0,"ButtonName",$avArray[$i][0]) If $ApplicationDistribMode = "Auto" Then $RadioHeight = $RadioHeight + 20 Next $AutoQUITTop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $AutoUPDATETop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $AutoUpdateINI = GUICtrlCreateButton("UPDATE", 375, $AutoUPDATETop, 100, 25) $AutoQuit = GUICtrlCreateButton("QUIT", 485, $AutoQUITTop, 100, 25) #EndRegion #Region Tab2 - Manual Apps $Manual = GUICtrlCreateTabItem("Manual") $ManualAppList = IniReadSectionNames("applicationstest.ini") ;~ Local $avArray[1000][1000] $RadioHeight = 150 For $j = 2 to $ManualAppList[0] $AppID = $j $ApplicationName = IniRead("applicationstest.ini",$ManualAppList[$j],"Name","") $ApplicationDistribMode = IniRead("applicationstest.ini",$ManualAppList[$j],"DistributionMode","") $ApplicationInstallScript = IniRead("applicationstest.ini",$ManualAppList[$j],"InstallScript","") $avArray[$i][0] = $ManualAppList[$j] If $ApplicationDistribMode = "Manual" Then $ManualAppList[$j] = GUICtrlCreateLabel($ApplicationName, 30, $RadioHeight, 140, 17) If $ApplicationDistribMode = "Manual" AND $ApplicationInstallScript <> "" Then $avArray[$j][0] = GUICtrlCreateButton("AutoInstall", 245, $RadioHeight, 75, 17) If $ApplicationDistribMode = "Manual" Then $RadioHeight = $RadioHeight + 20 $ManualAutoInstall = $ManualAutoInstall & $AppID ;~ msgbox(4096,"Button Info", $ManualAutoInstall) Next $ManualQUITTop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $ManualUPDATETop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $ManualUpdateINI = GUICtrlCreateButton("UPDATE", 375, $ManualUPDATETop, 100, 25) $ManualQuit = GUICtrlCreateButton("QUIT", 485, $ManualQUITTop, 100, 25) #EndRegion GUICtrlCreateTabItem("") $Header = GUICtrlCreateLabel(IniRead("applicationstest.ini","GUIConfig","Title",""), IniRead("applicationstest.ini","GUIConfig","TitleLeft",""), IniRead("applicationstest.ini","GUIConfig","TitleDown",""), IniRead("applicationstest.ini","GUIConfig","TitleWidth",""), IniRead("applicationstest.ini","GUIConfig","TitleHeight","")) GUICtrlSetFont(-1, 20, 800, 0, "Arial Black") $Intro = GUICtrlCreateLabel(IniRead("applicationstest.ini","GUIConfig","Info",""), 20, 56, 600, 55) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While $GUI <> "QUIT" $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Case $AutoQuit Exit Case $ManualQuit Exit Case $AutoUpdateINI msgbox(4096,"Hold on!", "Not done yet") Case $ManualUpdateINI msgbox(4096,"Hold on!", "Not done yet") Case $avArray[2][0] msgbox(4096,"App 1", "Application 1 Install Script goes here") Case $avArray[3][0] msgbox(4096,"App 2", "Application 2 Install Script goes here") Case $avArray[4][0] msgbox(4096,"App 3", "Application 3 Install Script goes here") Case $avArray[5][0] msgbox(4096,"App 4", "Application 4 Install Script goes here") Case $avArray[6][0] msgbox(4096,"App 5", "Application 5 Install Script goes here") Case $avArray[7][0] msgbox(4096,"App 6", "Application 6 Install Script goes here") Case $avArray[8][0] msgbox(4096,"App 7", "Application 7 Install Script goes here") Case $avArray[9][0] msgbox(4096,"App 8", "Application 8 Install Script goes here") Case $avArray[10][0] msgbox(4096,"App 9", "Application 9 Install Script goes here") Case $avArray[11][0] msgbox(4096,"App 10", "Application 10 Install Script goes here") Case $avArray[12][0] msgbox(4096,"App 11", "Application 11 Install Script goes here") Case $avArray[13][0] msgbox(4096,"App 12", "Application 12 Install Script goes here") ;~ Case $avArray2[2][0] ;~ msgbox(4096,"App2","Application 2 Install Script Goes here") EndSwitch WEndoÝ÷ Ù«¢+ÙmU% ½¹¥t)U%Q¥Ñ±ôÅÕ½ÐíÁÁ%¹Íѱ°ÅÕ½Ðì)U%!¥¡ÐôÅÕ½ÐìÔÀÀÅÕ½Ðì)U%]¥Ñ ôÅÕ½ÐìØÈÔÅÕ½Ðì)U%1ÐôÅÕ½Ðì´ÄÅÕ½Ðì)U%Q½ÀôÅÕ½Ðì´ÄÅÕ½Ðì)Q¥Ñ±ôÅÕ½ÐíÁÁ%¹Íѱ°ÅÕ½Ðì)Q¥Ñ±1ÐôÅÕ½ÐìÐàÅÕ½Ðì)Q¥Ñ±½Ý¸ôÅÕ½ÐìàÅÕ½Ðì)Q¥Ñ±!¥¡ÐôÅÕ½ÐìÐÈÅÕ½Ðì)Q¥Ñ±]¥Ñ ôÅÕ½ÐìÔÌÄÅÕ½Ðì)%¹¼ôÅÕ½ÐíÁÁ%¹¼ÍÉ¥ÁÑ¥½¸ÅÕ½Ðì)%¹Íѱ±É%¹¼ôÅÕ½Ðí%¹Íѱ±ÈÅÕ½Ðì)%¹Íѱ±%¹¼ôÅÕ½Ðí%¹Íѱ±üÅÕ½Ðì)QÅ9µôÅÕ½ÐíÕѼÅÕ½Ðì)QÉ9µôÅÕ½Ðí5¹Õ°ÅÕ½Ðì)Q!¥¡ÐôÅÕ½ÐìÌàÀÅÕ½Ðì)Q]¥Ñ ôÅÕ½ÐìÔÜÜÅÕ½Ðì)Q1ÐôÅÕ½ÐìÈÐÅÕ½Ðì)QQ½ÀôÅÕ½ÐìÄÄÈÅÕ½Ðì)UÁÑ ÕÑѽ¹9µôÅÕ½ÐíUAQÅÕ½Ðì)EÕ¥Ñ ÕÑѽ¹9µôÅÕ½ÐíEU%PÅÕ½Ðì(()mÁÁ±¥Ñ¥½¸Åt)9µôÅÕ½ÐíÁÀÄÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õÕѼ)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸Ét)9µôÅÕ½ÐíÁÀÈÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õ5¹Õ°)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸Ít)9µôÅÕ½ÐíÁÀÌÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õÕѼ)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸Ñt)9µôÅÕ½ÐíÁÀÐÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õÕѼ)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸Õt)9µôÅÕ½ÐíÁÀÔÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õ5¹Õ°)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸Ùt)9µôÅÕ½ÐíÁÀØÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õÕѼ)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸Ýt)9µôÅÕ½ÐíÁÀÜÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õÕѼ)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸át)9µôÅÕ½ÐíÁÀàÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õ5¹Õ°)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸åt)9µôÅÕ½ÐíÁÀäÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õÕѼ)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸ÄÁt)9µôÅÕ½ÐíÁÀÄÀÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õÕѼ)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸ÄÅt)9µôÅÕ½ÐíÁÀÄÄÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õ5¹Õ°)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì()mÁÁ±¥Ñ¥½¸ÄÉt)9µôÅÕ½ÐíÁÀÄÈÅÕ½Ðì)¥ÍÑÉ¥ÕÑ¥½¹5½õÕѼ)%¹Íѱ±MÉ¥ÁÐôÅÕ½ÐíÑÍйÐÅÕ½Ðì -
Can I Dynamically Create Variable Names?
Wader replied to Wader's topic in AutoIt General Help and Support
RunDMV and Martin - Thank you for your replies. I will give it a try and post the results. -
I am trying to read from an INI file and then create a two-tabbed GUI dynamically based upon what I read from the INI. I first count the number of section header in the INI and then run through two "For" loops to create "Buttons" for each of the applications that I read. I want to assign a variable to the Button based on the section header name so that I know what application to install, based on the button the user selects. Any idea on how to create a variable on the fly in my code? ;Example Code: Dim $GUI_DOCKHEIGHT, $GUI_DOCKWIDTH, $GUI_EVENT_CLOSE, $Label1, $Label2, $Manual, $GUI Dim $Application1, $Application2, $Application3, $Application4, $Application5, $Application6, $Application7, $Application8, $Application9, $Application10 Dim $ManualAutoInstall, $ManualAutoInstall1, $ManualAutoInstall2, $ManualAutoInstall3, $ManualAutoInstall4, $ManualAutoInstall5, $ManualAutoInstall6, $ManualAutoInstall7, $ManualAutoInstall8, $ManualAutoInstall9, $ManualAutoInstall10 Dim $AutoAutoInstall, $AutoAutoInstall1, $AutoAutoInstall2,$AutoAutoInstall3,$AutoAutoInstall4, $AutoAutoInstall5, $AutoAutoInstall6, $AutoAutoInstall7, $AutoAutoInstall8, $AutoAutoInstall9, $AutoAutoInstall10 #Region ### START Koda GUI section ### Form= $AppInstall = GUICreate(IniRead("applicationstest.ini","GUIConfig","GuiTitle",""), IniRead("applicationstest.ini","GUIConfig","GuiWidth",""), IniRead("applicationstest.ini","GUIConfig","GuiHeight",""), IniRead("applicationstest.ini","GUIConfig","GUILeft",""), IniRead("applicationstest.ini","GUIConfig","GUITop","")) $Auto = GUICtrlCreateTab(IniRead("applicationstest.ini","GUIConfig","TabLeft",""), IniRead("applicationstest.ini","GUIConfig","TabTop",""), IniRead("applicationstest.ini","GUIConfig","TabWidth",""), IniRead("applicationstest.ini","GUIConfig","TabHeight","")) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) #Region Tab1 - Auto Apps $Auto = GUICtrlCreateTabItem("Auto") $AutoAppList = IniReadSectionNames("applicationstest.ini") $RadioHeight = 150 For $i = 1 to $AutoAppList[0] $ApplicationName = IniRead("applicationstest.ini",$AutoAppList[$i],"Name","") $ApplicationDistribMode = IniRead("applicationstest.ini",$AutoAppList[$i],"DistributionMode","") $ApplicationInstallScript = IniRead("applicationstest.ini",$AutoAppList[$i],"InstallScript","") If $ApplicationDistribMode = "Auto" Then $AutoAppListName = GUICtrlCreateLabel($ApplicationName, 30, $RadioHeight, 140, 17) If $ApplicationDistribMode = "Auto" AND $ApplicationInstallScript <> "" Then $AutoApplistName = GUICtrlCreateButton("Auto Install", 245, $RadioHeight, 75, 17) If $ApplicationDistribMode = "Auto" Then $RadioHeight = $RadioHeight + 20 Next $AutoQUITTop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $AutoUPDATETop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $AutoUpdateINI = GUICtrlCreateButton("UPDATE", 375, $AutoUPDATETop, 100, 25) $AutoQuit = GUICtrlCreateButton("QUIT", 485, $AutoQUITTop, 100, 25) #EndRegion #Region Tab2 - Manual Apps $Manual = GUICtrlCreateTabItem("Manual") $ManualAppList = IniReadSectionNames("applicationstest.ini") $RadioHeight = 150 For $j = 1 to $ManualAppList[0] $AppID = $j $ApplicationName = IniRead("applicationstest.ini",$ManualAppList[$j],"Name","") $ApplicationDistribMode = IniRead("applicationstest.ini",$ManualAppList[$j],"DistributionMode","") $ApplicationInstallScript = IniRead("applicationstest.ini",$ManualAppList[$j],"InstallScript","") If $ApplicationDistribMode = "Manual" Then $ManualAppList[$j] = GUICtrlCreateLabel($ApplicationName, 30, $RadioHeight, 140, 17) If $ApplicationDistribMode = "Manual" AND $ApplicationInstallScript <> "" Then $ManualAutoInstall = GUICtrlCreateButton("AutoInstall", 245, $RadioHeight, 75, 17) If $ApplicationDistribMode = "Manual" Then $RadioHeight = $RadioHeight + 20 $ManualAutoInstall = $ManualAutoInstall & $AppID ;~ msgbox(4096,"Button Info", $ManualAutoInstall) Next $ManualQUITTop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $ManualUPDATETop=IniRead("applicationstest.ini","GUIConfig","TabHeight","")+75 $ManualUpdateINI = GUICtrlCreateButton("UPDATE", 375, $ManualUPDATETop, 100, 25) $ManualQuit = GUICtrlCreateButton("QUIT", 485, $ManualQUITTop, 100, 25) #EndRegion GUICtrlCreateTabItem("") $Header = GUICtrlCreateLabel(IniRead("applicationstest.ini","GUIConfig","Title",""), IniRead("applicationstest.ini","GUIConfig","TitleLeft",""), IniRead("applicationstest.ini","GUIConfig","TitleDown",""), IniRead("applicationstest.ini","GUIConfig","TitleWidth",""), IniRead("applicationstest.ini","GUIConfig","TitleHeight","")) GUICtrlSetFont(-1, 20, 800, 0, "Arial Black") $Intro = GUICtrlCreateLabel(IniRead("applicationstest.ini","GUIConfig","Info",""), 20, 56, 600, 55) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While $GUI <> "QUIT" $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Case $AutoQuit Exit Case $ManualQuit Exit Case $AutoUpdateINI msgbox(4096,"Hold on!", "Not done yet") Case $ManualUpdateINI msgbox(4096,"Hold on!", "Not done yet") Case $Application1 msgbox(4096,"App 1", "Application 1 Install Script goes here") Case $Application2 msgbox(4096,"App 2", "Application 2 Install Script goes here") Case $Application3 msgbox(4096,"App 3", "Application 3 Install Script goes here") EndSwitch WEnd
-
Very nice. I tested the server on Vista and it would not work, but GPO's force UAC on my system and this is probably the issue. XP ran like a champ. Adding remote control would very nice.
-
It wouldn't break the code, but it would not do what I am trying to accomplish. In the end, this will be running all the time until a different Node = 1. I am trying to update a database with the status of a process I am developing. If I have 100 different scripts running, when each script is finished or fails I will update a database with the current systems status. I could just add the code to all of the different scripts and this would fix the issue. I just don't want to have to rewrite everything unless I absolutely have to.
-
Just checked and you are correct. Still leaking, but not at the pace before. It acts the same with or without the FileClose. Any suggestions?
-
It is working now. The sleep seems to be the answer. I assume that the file was never getting closed before. Here is the code that works. I stripped out the functins that I had as well since they were not really needed. CODE#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=testXML.exe #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseAnsi=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GuiConstants.au3> #Include <_XMLDomWrapper.au3> #include <Array.au3> Dim $RetCode, $count, $FileOpen, $RetCode, $node $Count = 0 ;While $RetCode = 0 Do $fileopen = _XMLFileOpen("test.xml") $ret_val = _XMLGetValue("/test/RetCode") $RetCode = $ret_val[1] if $RetCode = 2 Then ExitLoop Sleep (500) FileClose($FileOpen) Until $RetCode = 2 msgbox(8192,"Failed","ReturnCode=" & $RetCode)
-
I still get the same thing with the new function.
-
I thought that FileClose would work since its just closing the handle. I don't want to save the XML or transform the XML. Am I over thinking this?
-
Is there no takers on this? Am I missing something easy?
-
I am created code to monitor a value in an XML file. My code functions, but the memory its using increases without stop. Any ideas on what I am doing wrong? CODE#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=testXML.exe #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseAnsi=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GuiConstants.au3> #Include <_XMLDomWrapper.au3> #include <Array.au3> Dim $RetCode, $count, $FileOpen, $RetCode $Count = 0 While $RetCode = 0 $fileopen = _XMLFileOpen("e:\test.xml") _WaitForError() if $RetCode = 2 Then ExitLoop FileClose($FileOpen) WEnd SplashOff() msgbox(8192,"Failed","ReturnCode=" & $RetCode) Func _WaitForError(); $RetCode = _GetFirstValue("/Test/RetCode") EndFunc Func _GetFirstValue($node) $ret_val = _XMLGetValue($node) If IsArray($ret_val) Then Return ($ret_val[1]) Else Return SetError(1,3,0) EndIf EndFunc