MNT Posted November 20, 2008 Posted November 20, 2008 Hi All, I am a naive when it comes to scripting. I am trying my hands for the first time. I am not able to understand why my script stops working when I use AND in line 21? I want the notepad to open when both C2641 (from the combo list) and OK button are selected. But its not working. Can anyone please give me basic examples on how to use the combo list entries? #include <GUIConstants.au3> #include <GUIConstantsEx.au3> local $a, $b, $msg, $comp, $sel, $val GUICreate ("PING C264") $a = GUICtrlCreateCombo (" ", 10,20,70,30) $comp = GUICtrlSetData($a, "C2641|C2642|C2643|C2644|C264S1" , " ") $b = GUICtrlCreateButton ("PING", 10,50,70,30) $sel = GUICtrlSetState(-1, $GUI_FOCUS) $c = GUICtrlCreateLabel ("C264-LIST", 100,25) $d = GUICtrlCreateButton ("OK", 200,20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $d And $a = "C2641" MsgBox(0, "GUI Event", "You have selected C2641") Run ("notepad.exe", "", @SW_MAXIMIZE) Case $msg = $b RunWait(@ComSpec & " /c " & 'ping 192.168.0.10', "", @SW_MAXIMIZE) Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEndping.au3
ChangMinYang Posted November 20, 2008 Posted November 20, 2008 Hi All,I am a naive when it comes to scripting. I am trying my hands for the first time. I am not able to understand why my script stops working when I use AND in line 21?I want the notepad to open when both C2641 (from the combo list) and OK button are selected. But its not working.Can anyone please give me basic examples on how to use the combo list entries?#include <GUIConstants.au3>#include <GUIConstantsEx.au3>local $a, $b, $msg, $comp, $sel, $valGUICreate ("PING C264")$a = GUICtrlCreateCombo (" ", 10,20,70,30)$comp = GUICtrlSetData($a, "C2641|C2642|C2643|C2644|C264S1" , " ")$b = GUICtrlCreateButton ("PING", 10,50,70,30)$sel = GUICtrlSetState(-1, $GUI_FOCUS)$c = GUICtrlCreateLabel ("C264-LIST", 100,25)$d = GUICtrlCreateButton ("OK", 200,20)GUISetState()While 1 $msg = GUIGetMsg() Select Case $msg = $d And $a = "C2641" MsgBox(0, "GUI Event", "You have selected C2641") Run ("notepad.exe", "", @SW_MAXIMIZE) Case $msg = $b RunWait(@ComSpec & " /c " & 'ping 192.168.0.10', "", @SW_MAXIMIZE) Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelectWEndSelect statements may be nested.The expression can contain the boolean operators of AND, OR, and NOT as well as the logical operators <, <=, >, >=, =, ==, and <> grouped with parentheses as needed.
dbzfanatic Posted November 20, 2008 Posted November 20, 2008 Your data is never read. Try using GUICtrlRead($a) = "C2641" or using an If statement inside the case instead of making it multi-conditional. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
amel27 Posted November 20, 2008 Posted November 20, 2008 Case $msg = $d And GUICtrlRead($a) = "C2641"
dbzfanatic Posted November 20, 2008 Posted November 20, 2008 Case $msg = $d And GUICtrlRead($a) = "C2641"Pretty sure that's what I said about an hour ago. Good practice is to wait to see if the OP understands the information. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
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