代码大全

(singke) #1

if the error code is valid
determine the processing method
if doing interactive processing
print the error message interactively and declare success
else doing batch processing
if the batch message file opens properly
log the error message to the batch file,
close the file, and declare success
else the message code is not valid
notify the user that an internal error has been detected


ErrorCode Status


PDL Pascal Begin End C
PDL PDL Pascal
procedure RecordErrorMessage
(
Errorcode:ErrorCode_t
var Status:Status_t
);


{ This routine outputs an error message based on an error code
Supplied by the calling routine. The way it outputs the message
depends on the current processing state, which it retrieves
on its own. It returns a variable indicating success or failure.}


begin
{ set the default status }
{ look up the message based on the error code }
{ if the error code is valid
{ determine the processing method }
{ if doing interactive processing}
{ print the error message interactively and declare success}
{ else doing batch processing }
{ if the batch message file opens properly}
{log the error message to the batch file,
close the file and declare success}
{else the message code is not valid}
{ notify the user that an internal error has been detected}
end; { RecordErrorMessage() }


PDL

Free download pdf