Jump to content

Why does it goes in to the 2. case?


Go to solution Solved by Gianni,

Recommended Posts

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 by SorryButImaNewbie
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...