Gyba Posted February 19, 2018 Share Posted February 19, 2018 I have a window where I need to insert some data to make a purchase order. I can get 2 errors if the order is not filled in correctly (Purchased failed & Qnt not permitted). What I want to do is to check if an error window is generated and if it is (Purchased failed or Qnt not permitted), to close the error window and the Purchase Order window. I am using the below code: WinGetHandle("Purchase order") If WinExists('Purchase failed') Or WinExists('Qnt not permitted') Then WinClose('Purchase failed') and WinClose('Purchase order') and WinClose('Qnt not permitted') Else MsgBox(0, 'Text', 'Purchase completed') EndIf When I try to run the script I receive the error: Statement cannot be just an expression - for WinClose('Purchase failed') and WinClose('Purchase order') and WinClose('Qnt not permitted') Can you please suggest a solution? Link to comment Share on other sites More sharing options...
Au3Builder Posted February 19, 2018 Share Posted February 19, 2018 (edited) WinGetHandle("Purchase order") If WinExists('Purchase failed') Or WinExists('Qnt not permitted') Then WinClose('Purchase failed') WinClose('Purchase order') WinClose('Qnt not permitted') Else MsgBox(0, 'Text', 'Purchase completed') EndIf Edited February 19, 2018 by Au3Builder 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