SorryButImaNewbie Posted January 13, 2015 Posted January 13, 2015 (edited) I think I missunderstand something with Switch...Case...EndSwitch (wich is a problem since its a pretty important loop ) My function goes like this: Local $check = _IEDocReadHTML($oIE) $check = StringInStr($check, "Elektronikus értékesítés tájékoztató | Nemzeti Útdíjfizetési Szolgáltató") MsgBox(0, "Check", "Érték:" & $check) Switch $check Case $check = 0 Local $oForm = _IEFormGetObjByName($oIE, "container") If Not IsObj($oForm) Then MsgBox(0, 'Error', 'nem objektum a $oForm') Local $checkbox248 = _IEFormElementGetObjByName($oForm, "ctl00$wpm$UserControlPortlet1302082381$ctl00_wpm_UserControlPortlet1302082381_userControlPortlet$cbErvEmail") _IEFormElementSetValue($checkbox248, 0) _IEFormElementCheckBoxSelect($checkbox248, "", "ctl00$wpm$UserControlPortlet1302082381$ctl00_wpm_UserControlPortlet1302082381_userControlPortlet$cbErvEmail", 0) Local $Belepes = _IEGetObjById($oIE, 'ctl00_wpm_UserControlPortlet1302082381_ctl00_wpm_UserControlPortlet1302082381_userControlPortlet_btnAdatokMegadasa') Sleep(500) Send('{DOWN 3}') ;MsgBox(0,"Teszt","érték:" & $Belepes) _IEAction($Belepes, "click") Sleep(1500) Local $oObj = _IEGetObjByName($oIE, "ctl00$wpm$UserControlPortlet1302082381$ctl00_wpm_UserControlPortlet1302082381_userControlPortlet$btnEllenorzeshez") If Not IsObj($oObj) Then ; Validate your code is working, you can't get past this point if $oObj isn't an actual object ; set some error code here and debug MsgBox(0, 'Error', 'error') EndIf _IEAction($oObj, "click") _IELoadWait($oIE) Case Not ($check = 0) Local $logo = _IEGetObjById($oIE, "logo") _IEAction($logo, "click") Ematrica_Kattintas() EndSwitch MsgBox tells me the value of $check is 0 yet it goes in to the 2. case "socket". I would assume that "Not ($check = 0)" isn't the right syntax I want to use, but then it still should go to the first socket isn't it? So what do I do wrong? Thanks for the help! Cheers! TheVilliageIdiot Edited January 13, 2015 by SorryButImaNewbie
Solution Gianni Posted January 13, 2015 Solution Posted January 13, 2015 try this syntax for case: Case 0 instead of Case $check = 0 SorryButImaNewbie 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
SorryButImaNewbie Posted January 13, 2015 Author Posted January 13, 2015 (edited) Ahhhh! Since I told it to check the $check right after the switch! Thats completly logical. Thank you very much (edit: not just logical, but naturally it works like it should) Edited January 13, 2015 by SorryButImaNewbie
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