mvslovers / brexx370

MVS version of Vasilis Vlachoudis awesome rexx implementation
46 stars 11 forks source link

SIGNAL ON ERROR #84

Closed JohanD66 closed 3 years ago

JohanD66 commented 3 years ago

SIGNAL ON ERROR does not trap a CALL to another NON existing file.

mgrossmann commented 3 years ago

Hello Johan,

thank you for filing this issue. Can you provide some example code, please?

/MIG

JohanD66 commented 3 years ago
/* REXX */

/* *********************************************************** */
/* IMPORT THE API LIBRARY */
CALL IMPORT FSSAPI
/* ADDRESS THE FSS SUBSYSTEM */
ADDRESS FSS
/* SWITCH TO FULL SCREEN MODE */
CALL FSSINIT
/* *********************************************************** */

SIGNAL ON ERROR

/* CALL INTERNAL FUNCTION TO BUILD THE MENU SCREEN */
MENUTITLE = 'Main Menu'
CALL MENU

/* SHOW SCREEN UNTIL PFK05 PRESSED */
DO FOREVER
   /* UPDATE FIELD VALUES */
   CALL UPDATE
   /* REFRESH / SHOW SCREEN */
   RCKEY=FSSREFRESH()
   IF RCKEY==#PFK05 | RCKEY==#PFK17 THEN LEAVE
   SEL = STRIP(FSSFGET('_ZCMD'))
   CALL FSSZERRLM '                                                     '
   SELECT
      WHEN SEL == 1 THEN
        DO
          CALL BISACC
        END
      WHEN SEL == 2 THEN
        DO
          CALL BISHR
        END
      WHEN SEL == 3 THEN
        DO
          CALL BISSLA
        END
      WHEN SEL == 4 THEN
        DO
          CALL BISVER
        END
      WHEN SEL == 5 THEN
        DO
        END
      WHEN SEL == '6' THEN
        DO
        END
      WHEN SEL == '7' THEN
        DO
        END
      WHEN SEL == 'x' THEN LEAVE
      WHEN SEL == 'X' THEN LEAVE
     OTHERWISE CALL FSSZERRLM 'Invallid option, please select from the menu'
   END
END

CALL FSSCLOSE
EXIT

MENU:
 CALL HEADER
 CALL ENTRY 1,"ACCOUNTING  " ,'  Accounting all companies'
 CALL ENTRY 2,"HR "          ,'  Human Resources'
 CALL ENTRY 3,"SLA"          ,'  Service Level Agreements'
 CALL ENTRY 4,"VERSION"      ,'  Show BREXX/370 version'
 /*
 CALL ENTRY 5,"HELP"       ,'general TSO help'
 CALL ENTRY 6,"UTILS"      ,'information on utilities and commands available'
 CALL ENTRY 7,"TERMTEST"   ,'verify 3270 terminal capabilities'
 */
 CALL PFKEYS
RETURN

PFKEYS:
 CALL FSSTEXT "PF1=Help  PF5/PF17=Logoff",24,1,,#PROT+#BLUE
RETURN

/* ********** NOTHING BELOW TO CHANGE *************************** */

UPDATE:
 CALL FSSFSET   '_USRID' , USERID()
 CALL FSSFSET   '_DATE'  , TODAY()
 CALL FSSFSET   '_TIME'  , TIME()
 CALL FSSCURSOR '_ZCMD'
RETURN

HEADER:
 CALL FSSTEXT "TSO User",1,1,,#PROT+#BLUE; CALL FSSFIELD '_USRID' ,1,11,8,#PROT+#BLUE
 CALL FSSTEXT "Date",1,66,,#PROT+#BLUE; CALL FSSFIELD '_DATE',1,72,8,#PROT+#BLUE
 CALL FSSTEXT "Time",2,66,,#PROT+#BLUE; CALL FSSFIELD '_TIME',2,72,8,#PROT+#BLUE
 CALL FSSTEXT "BIS Information Systems RX/1 BREXX/370",1,20,,#PROT+#WHITE+#HI
 CALL FSSTEXT MENUTITLE,2,20,,#PROT+#WHITE+#HI
 CALL FSSMESSAGE 23,#PROT+#HI+#YELLOW
 CALL FSSTEXT "Option ===>",3,1,,#PROT+#BLUE; CALL FSSFIELD '_ZCMD',3,1 3,67,#RED+#USCORE
RETURN

ENTRY:
 PARSE ARG NUM,SHORT,LONG
 CALL FSSTEXT NUM  ,7+NUM, 6,,#PROT+#WHITE
 CALL FSSTEXT SHORT,7+NUM, 9,,#PROT+#TURQ
 CALL FSSTEXT LONG ,7+NUM,20,,#PROT+#GREEN
RETURN

ERROR:
 CALL FSSZERRLM 'Error occured: ' RC
RETURN
mgrossmann commented 3 years ago

@JohanD66

I did update your last comment to fix the hilighting...

You can use: ```rexx ... ```

mgrossmann commented 3 years ago

As discussed on our discord channel,

SIGNAL ON SYNTAX

is the way to go here.

best Mike