Sign in to follow this  
Followers 0
LovinItAll

Why does this not work?

4 posts in this topic

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"

Share this post


Link to post
Share on other sites



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

[center]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.[/center]

Share this post


Link to post
Share on other sites

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.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

Thank you!

Share this post


Link to post
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
Sign in to follow this  
Followers 0