Purpose

TASK_EXIT() automatically links to the Task Exit or Task Error function and return error codes.
 

Syntax

TASK_EXIT (Err# {‘U’, <message string>|<argument list>})
 

Operation

Err# is the error message number. 
message string
 is any defined variable.  It can be the string passed to UMSG in the preceding call.  The presence of a message string is flagged by the character ‘U’. 
argument list
 is an optional list of values to be inserted into parameterized error message. 
If the second argument is ‘U’, then the argument list is not used. The message string overwrites the message ids text. 

The syntax is either ‘U’ <message string> or  <argument list>.
 

Remarks

The error number supplied should be the message id of a message defined for the function. 

The error numbers are incremented by 1000 and the message is stored in @ERR and @ERRTEXT. 

If no error number is supplied error number 1000 is returned.  

The assigned ERR# overrides any PROIV system error messages already stored. 

The function is processed as if FNEXIT was executed and the task error function is executed.  If the task is already executing the task error function when TASK_EXIT() id executed, the task is considered finished. 

In component mode, the contents of @ERR are returned to the caller.  The caller can distinguish between PROIV errors and application errors by looking at the range of the error number.  If the number is greater than 1000, the error is generated by the application.  If there are no error numbers, the TASK_EXIT() function is executed and the status ‘SUCCESS’ is returned to the caller.

If there is no active task when TASK_EXIT() is executed, it behaves like FNEXIT().
 

Example

TASK_EXIT (200, ‘U’, “Task not ready")  -

PROIV adds 1000 to the error message number when it processes the command.  In this example, the number returned by the kernel to the caller is 1200, text is "Task not ready".
 

Comment on this topic

Topic ID: 520127

 
 
 

Table of Contents

Index

Glossary

-Search-

Back