FUNCTION LONG Sys_Report_Message(LONG Code) !++ ! ! Author: Jonathan Welch ! ! Functional Description: ! ! Gets the text associated with Code and prints it out. ! ! Formal arguments: ! ! Code ! VMS Usage : longword_unsigned ! type : longword (unsigned) ! access : read only ! mechanism : by reference ! ! A VMS error code. ! ! Implicit Inputs: ! ! none ! ! Implicit Outputs: ! ! none ! ! Routine Value: ! ! SS$_NORMAL Routine completed successfully ! ! Any value returned by SYS$GETMSG ! !-- EXTERNAL LONG FUNCTION SYS$GETMSG(LONG BY VALUE, WORD BY REF, & STRING BY DESC, LONG BY VALUE, & BYTE BY REF) DECLARE LONG Sts DECLARE STRING Message DECLARE WORD Msglen EXTERNAL LONG CONSTANT SS$_NORMAL Sys_Report_Message = SS$_NORMAL ! System services need initialized strings. Message = STRING$(80%, ASC(" ")) ! It would be nice if the status return value could be checked ! but if this call fails calling the same routine again would be silly. Sts = SYS$GETMSG(Code, Msglen, Message, 15%,) IF Msglen >= 1 THEN PRINT MID$(Message, 1, Msglen) ELSE Sys_Report_Message = Sts END IF FUNCTIONEND