thistleback 0 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 Share this post Link to post Share on other sites
Jos 2,281 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. Share this post Link to post Share on other sites
PsaltyDS 42 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 Share this post Link to post Share on other sites
thistleback 0 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! Share this post Link to post Share on other sites
Jos 2,281 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. Share this post Link to post Share on other sites