Informix Error -1141
-1141 Cannot close window with active INPUT, DISPLAY ARRAY, or MENU statement.
This CLOSE WINDOW statement cannot be executed because an input operation is still active in that window. The CLOSE WINDOW statement must have been contained in, or called from within, the input statement itself. Review the program logic, and revise it so that the statement completes before the window is closed.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1141 fires when CLOSE WINDOW is attempted while an INPUT, DISPLAY ARRAY, or MENU
statement is still active in that window — per the official guidance, this typically happens when
CLOSE WINDOW is nested within, or invoked from, logic that runs during an active input
operation.
CLOSE WINDOWcalled from within an activeINPUT/DISPLAY ARRAY/MENUstatement's own logic (e.g. anON KEY/action clause), per the official guidance — the direct, common cause.- Program flow that doesn't wait for the input operation to complete before closing its window, a structural ordering problem.
Solutions / Resolution
- Restructure the program logic so the input statement completes before closing the
window, per the official guidance — let
INPUT/DISPLAY ARRAY/MENUfinish (or be explicitly exited) first, then close the window afterward.
Examples
Closing the window from inside an active INPUT
INPUT BY NAME order_id, status
ON KEY (INTERRUPT)
CLOSE WINDOW w1
-- -1141: the INPUT statement using this window is still active
END INPUT
Corrected — close after the statement completes
INPUT BY NAME order_id, status
ON KEY (INTERRUPT)
EXIT INPUT
END INPUT
CLOSE WINDOW w1
Diagnostic Checks
- Check whether
CLOSE WINDOWis being called from within the active input operation's own logic, and move it to run only after that statement has actually completed.
Related Errors / Related Topics
- -1137 — "Cannot open window." A related window error, about insufficient memory rather than a statement-still-active ordering problem.
CLOSE WINDOW was called while an INPUT/DISPLAY ARRAY/MENU statement in that window was
still active — restructure so the window closes only after the statement completes.