Initializing user‑overloadable routines

%RW_INIT calls RW_INIT_METHOD before opening any files, thereby enabling you to register any of your user‑overloadable routines for use by %RW_REPORTS.

RW_INIT_METHOD

subroutine RW_INIT_METHOD
    a_status     ,n     ;RETURNED – You must set this to be 0 if there are no 
                        ; errors and to a nonzero value if there is an error.

Discussion

Use RW_INIT_METHOD to initialize your user‑overloadable routines. It should call %RW_METHOD or %RPS_METHOD to register your customized routines. If any error occurs in a given %RPS_METHOD or %RW_METHOD, no further tries are made. %RW_INIT will return the error information from the routine that failed.

RW_INIT_METHOD can also include calls to UI Toolkit’s E_METHOD subroutine to overload desired Toolkit routines such as EHELP_METHOD, EFKEY_METHOD, and so on. After the return from this call, ReportWriter will register its own overloaded Toolkit routines.

RW_INIT_METHOD is also an appropriate place from which to call the Synergy DBL LOCALIZE subroutine, to apply European formatting conventions to numeric values.

Examples

subroutine rw_init_method
    a_sts       ,n
.include "RPTLIB:reports.def"
record
        err     ,i4
proc
; Comment out any routines that you do not overload
    err = %rps_method(M_RPS_CLOSE, "RPS_CLOSE_METHOD")
    err = (err .or. %rps_method(M_RPS_OPEN, "RPS_OPEN_METHOD"))
    err = (err .or. %rps_method(M_RPS_READ, "RPS_READ_METHOD"))
    err = (err .or. %rps_method(M_RPS_READS, "RPS_READS_METHOD"))
    err = (err .or. %rps_method(M_RPS_FILNAM, "RPS_FILNAM_METHOD"))
    err = (err .or. %rw_method(M_RW_PRTOPEN, "RW_PRTOPEN_METHOD"))
    err = (err .or. %rw_method(M_RW_PRTCLOSE, "RW_PRTCLOSE_METHOD"))
    err = (err .or. %rw_method(M_RW_ENV, "RW_ENV_METHOD"))
    err = (err .or. %rw_method(M_RW_HEADER, "RW_HEADER_METHOD"))
    err = (err .or. %rw_method(M_RW_FOOTER, "RW_FOOTER_METHOD"))
    err = (err .or. %rps_method(M_RPS_DATA, "RPS_DATA_METHOD"))
    err = (err .or. %rw_method(M_RW_GETVAL, "RW_GETVAL_METHOD"))
    err = (err .or. %rw_method(M_RW_USAGE, "RW_USAGE_METHOD"))
    err = (err .or. %rw_method(M_RW_LSTINFO, "RW_LSTINFO_METHOD"))
    err = (err .or. %rw_method(M_RW_INITBLD, "RW_INITBLD_METHOD"))
    a_sts = err
; You can overload UI Toolkit user–defined routines for ReportWriter. 
; Here, the check field method is overloaded for checking the input value
; of a user–defined question field.
    xcall e_method(D_METH_CHKFLD, "ECHKFLD_METHOD")
    xreturn
endsubroutine