thistleback Posted May 5, 2010 Share Posted May 5, 2010 Please excuse a new user for asking a simple question. I have a syntax error but cannot figure out why. The checker reported "S:\_Branch 8\IT Department\Scripts\easyLENDER_Upgrade\2010-5_Update\Upgrade_easyACCESS-v7.05_Update_2.au3(32,1) : ERROR: syntax error ElseIf Here is the lines of code. Can someone tell me what the error is? If WinWaitActive($WindowTitle, "Complete") Then ControlClick($WindowTitle, "", 503) ; Click on Finish button ElseIf WinWaitActive($WindowTitle, "Maintenance Complete") Then ControlClick($WindowTitle, "", 4) Else EndIf Link to comment Share on other sites More sharing options...
Developers Jos Posted May 5, 2010 Developers Share Posted May 5, 2010 You cannot have a one-line If...Then and also use ElseIf/Else If WinWaitActive($WindowTitle, "Complete") Then ControlClick($WindowTitle, "", 503) ; Click on Finish button ElseIf WinWaitActive($WindowTitle, "Maintenance Complete") Then ControlClick($WindowTitle, "", 4) Else EndIf SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 5, 2010 Share Posted May 5, 2010 If you are going to use the single-line syntax for If/Then, you cannot also have Else/ElseIf/EndIf. Just put your conditional ControlClick() on the line after IF, and the conditional one after ElseIf on the line after that. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
thistleback Posted May 5, 2010 Author Share Posted May 5, 2010 You cannot have a one-line If...Then and also use ElseIf/Else If WinWaitActive($WindowTitle, "Complete") Then ControlClick($WindowTitle, "", 503) ; Click on Finish button ElseIf WinWaitActive($WindowTitle, "Maintenance Complete") Then ControlClick($WindowTitle, "", 4) Else EndIf Thank you. The help file wasn't as much help as a real live person! Link to comment Share on other sites More sharing options...
Developers Jos Posted May 5, 2010 Developers Share Posted May 5, 2010 Thank you. The help file wasn't as much help as a real live person!Helpfile is pretty clear in showing the 2 options I would think. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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