Jump to content

How to close 2 windows


Gyba
 Share

Recommended Posts

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...