/* FW_CloseWindow.rexx 1.0 (04.01.95) by NDY's

Tries to force FinalWrapper to exit.
If this doesn't succeed, it tries closes the window.
In this case, FinalWrapper can't be started anymore before the next reset. */

port="FinalWrapperPort"
IF Show("P",port) THEN
  DO
    ADDRESS VALUE port
    Abort
    Lock RESET
    Die
    IF RESULT~=0 & RESULT~="RESULT" | RC~=0 THEN Die 1
    ADDRESS COMMAND Wait 5 SECS
    IF Show("P",port) THEN ADDRESS "apig.task.1" DIE
  END
ELSE
  ADDRESS "apig.task.1" DIE
EXIT
