sFunName = CwErrorMsg()
sFunName (string) The name of the P>G PRO function or
procedure in which the last exception was raised.
This function returns the error message returned by P>G PRO in response to the error. If the error did not occur inside a P>G PRO call, this function returns the empty string. In this way, it can be used to determine if a trapped error is a result of a P>G PRO error or other REXX error.
See the section on error handling for more details.
/* Function to attempt to load the requested project and return a flag
to indicate success or failure, displaying an error message if
appropriate. */
loadFile:procedure
parse arg projectFile
signal on syntax name cantload /* Trap syntax errors.*/
call CwImportProject projectFile
/* Success. Switch trapping off and return. */
signal off syntax
return 1
/* Failure.*/
cantload:
signal off syntax
/* Check if the error isn't really something in the REXX end. */
msg = CwGetErrorMsg()
if msg = '' then do
say "REXX syntax error."
exit
end
else do
/* OK, it's ours. Print an error message, clean up and return.*/
say 'Error: ' msg 'in' CwGetErrorFun()
call CwClearError
end
return 0
![]() Functions by NAME |
![]() Index |
![]() Functions by PURPOSE |