MattX Posted January 7, 2005 Share Posted January 7, 2005 (edited) Can someone please explain why I am getting a:Error: "EndIf" statement with no matching "If" statementWith this code:; AutoIt Version: 3; Language: English; Platform: WinXP; Author: ************@*********; Script Function: Message Of The Day Program$__msgbox = MsgBox(64, 'St Johns Network Message Of The Day', _ 'Test message for the St Johns Network Message Of The Day Program.' & @CRLF & _ @CRLF & _ 'Matt ***** - IT Tech' & @CRLF & _ @CRLF & _ 'Click on OK to close this box.') & @CRLF & _ If ($__msgbox = 1) ThenExitEndifMy brain is gonna explode - I've already shouted at my computer as there is a IF statement in there.Is It Obvious ? Am I stupid ?If I take out the If and Endif then the message appears and when you click on the OK button you get a "Error In Expression" error ? Is that because there is no code for the return value ? Edited January 7, 2005 by MattX Link to comment Share on other sites More sharing options...
Administrators Jon Posted January 7, 2005 Administrators Share Posted January 7, 2005 Can someone please explain why I am getting a:Error: "EndIf" statement with no matching "If" statementWith this code:My brain is gonna explode - I've already shouted at my computer as there is a IF statement in there.Is It Obvious ? Am I stupid ?If I take out the If and Endif then the message appears and when you click on the OK button you get a "Error In Expression" error ? Is that because there is no code for the return value ?You've got a line continutation character _ on the previous line to the IF statement so it gets merged with the line above - so AutoIt doesn't think there is an IF statement there then. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
MattX Posted January 7, 2005 Author Share Posted January 7, 2005 You've got a line continutation character _ on the previous line to the IF statement so it gets merged with the line above - so AutoIt doesn't think there is an IF statement there then. <{POST_SNAPBACK}>You know what, I just noticed that on the script - took it out and it worked - thanks for the quick reply Jon - as usual there is a line up of drinks in bar in Birmingham if I ever get to meet you.... Link to comment Share on other sites More sharing options...
herewasplato Posted January 7, 2005 Share Posted January 7, 2005 try this: $__msgbox = MsgBox(64, 'St Johns Network Message Of The Day', _ 'Test message for the St Johns Network Message Of The Day Program.' & @CRLF & _ @CRLF & _ 'Matt ***** - IT Tech' & @CRLF & _ @CRLF & _ 'Click on OK to close this box.') If ($__msgbox = 1) Then Exit EndIf Jon beat me to the post... Scite and Tidy might help you......... [size="1"][font="Arial"].[u].[/u][/font][/size] 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