1 FUNCTION STRING Get_Error_Message(LONG Message_id) !***************************************************************& ! & ! Get_Error_Message & ! & ! This function returns the complete error message text for a & ! given error code from the system message file. This function & ! should be used to obtain error messages associated with & ! system service and run time library calls. & ! & !---------------------------------------------------------------& ! & ! Creation date: 11-Jul-1985 & ! Author: KRM & ! & ! Modification history & ! & ! Date Description of change(s) & ! & ! & !***************************************************************& OPTION TYPE = INTEGER, SIZE = INTEGER LONG !***************************************************************& ! & ! D A T A D E C L A R A T I O N S & ! & !***************************************************************& DECLARE WORD Message_length DECLARE LONG Message_flag, RS EXTERNAL LONG FUNCTION SYS$Getmsg !***************************************************************& ! & ! M A P S T A T E M E N T S & ! & ! C O M M O N S & ! & !***************************************************************& ! Maximum message length is 256 bytes MAP (Msg) STRING Message_buffer = 256 !***************************************************************& ! & ! M A I N P R O G R A M L O G I C & ! & !***************************************************************& ! Set the message flag so as to return the complete message Message_flag = 15 RS = SYS$Getmsg(Message_id BY VALUE,Message_length,Message_buffer, & Message_flag BY VALUE,) Get_Error_Message = SEG$(Message_buffer,1,Message_length) EXIT FUNCTION END FUNCTION