Jump to content
Sign in to follow this  
Gyba

How to close 2 windows

Recommended Posts

Gyba

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? 

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  

×