Informix Error -4365: Deferments of interrupt or quit may be executed only in the main program.
Cause and resolution
Deferments of interrupt or quit may be executed only in the main program.
The statements DEFER INTERRUPT and DEFER QUIT can only appear in the MAIN section of the program. They can appear only once each in a program.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4365 fires when DEFER INTERRUPT or DEFER QUIT appears outside the MAIN section — per
the official guidance, both statements can only appear in MAIN, and each only once per
program.
DEFER INTERRUPT/DEFER QUITused outsideMAIN, per the official guidance — the first named case.DEFER INTERRUPT/DEFER QUITused more than once in the program, per the official guidance — the second named case.
Solutions / Resolution
- Move
DEFER INTERRUPT/DEFER QUITinto theMAINsection, per the official guidance. - Use each statement only once per program, per the official guidance.
Examples
DEFER INTERRUPT outside MAIN
FUNCTION setup()
DEFER INTERRUPT
-- -4365: DEFER INTERRUPT is only valid in MAIN
END FUNCTION
Corrected
MAIN
DEFER INTERRUPT
CALL setup()
END MAIN
Diagnostic Checks
- Check where every
DEFER INTERRUPT/DEFER QUITstatement appears, and confirm each is insideMAINand used only once.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4365 in this set yet.
DEFER INTERRUPT/DEFER QUIT is used outside MAIN (or more than once) — move it into
MAIN and use it only once.