LovinItAll Posted February 23, 2006 Share Posted February 23, 2006 It's late, and I may be getting a little dense, but why do I get: "EndIf" statement with no matching "If" statement.: with the following: (forget about the actual code and whether it will work or not. I'm wondering why I get the "no matching If statement") #include <GUIConstants.au3> #include <IE.au3> $Count=1 If @error Then $Count = 2 While $Count = 1 $oCust1 = _IEFormElementGetObjByName ($oForm, "selcust", 0) $oCust1.checked = True $oCust2 = _IEFormElementGetObjByName ($oForm, "selcust", 1) $oCust2.checked = True $count=2 WEnd EndIf and the same message with: #include <GUIConstants.au3> #include <IE.au3> If @error Then $Count = 2 Endif While $Count = 1 $oCust1 = _IEFormElementGetObjByName ($oForm, "selcust", 0) $oCust1.checked = True $oCust2 = _IEFormElementGetObjByName ($oForm, "selcust", 1) $oCust2.checked = True $count=2 WEnd This, of course, is while attempting to "Beta Run" Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 23, 2006 Moderators Share Posted February 23, 2006 It's late, and I may be getting a little dense, but why do I get: with the following: (forget about the actual code and whether it will work or not. I'm wondering why I get the "no matching If statement") #include <GUIConstants.au3> #include <IE.au3> $Count=1 If @error Then $Count = 2 While $Count = 1 $oCust1 = _IEFormElementGetObjByName ($oForm, "selcust", 0) $oCust1.checked = True $oCust2 = _IEFormElementGetObjByName ($oForm, "selcust", 1) $oCust2.checked = True $count=2 WEnd EndIf and the same message with: #include <GUIConstants.au3> #include <IE.au3> If @error Then $Count = 2 Endif While $Count = 1 $oCust1 = _IEFormElementGetObjByName ($oForm, "selcust", 0) $oCust1.checked = True $oCust2 = _IEFormElementGetObjByName ($oForm, "selcust", 1) $oCust2.checked = True $count=2 WEnd This, of course, is while attempting to "Beta Run" #include <GUIConstants.au3> #include <IE.au3> $Count=1 If @error Then $Count = 2 While $Count = 1 $oCust1 = _IEFormElementGetObjByName ($oForm, "selcust", 0) $oCust1.checked = True $oCust2 = _IEFormElementGetObjByName ($oForm, "selcust", 1) $oCust2.checked = True $count=2 WEnd EndIf Or #include <GUIConstants.au3> #include <IE.au3> $Count=1 If @error Then $Count = 2 While $Count = 1 $oCust1 = _IEFormElementGetObjByName ($oForm, "selcust", 0) $oCust1.checked = True $oCust2 = _IEFormElementGetObjByName ($oForm, "selcust", 1) $oCust2.checked = True $count=2 WEnd Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BigDod Posted February 23, 2006 Share Posted February 23, 2006 If you look at If...Then in the help file you will see that If @error Then $Count = 2 does not need an EndIf but If @error Then $Count = 2 does. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
LovinItAll Posted February 23, 2006 Author Share Posted February 23, 2006 Thank you! Link to comment Share on other sites More sharing options...
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