RAD function: messages

A RAD function that provides logging functions for use in the memory message log. The log is implemented as a wraparound cache of the n most recent messages.

Function

messages

Format

messages($function_number, $function_parameter)

Parameters

Parameters for this function are as follows:

Function Parameters Action
0 0-500 Open message log with 0 to 500 entries.
1 None Start or resume logging.
2 None Stop logging.
3 None Stop logging and clear the log.
4 None Close the log and recover memory.
5 0 Retrieve array of all log entries in most recently displayed order. The log is not cleared.
5 1 Retrieve array of logged informational messages in last displayed order; excludes error and action messages. The log is not cleared.
5 2 Retrieve array of logged action messages in last displayed order; excludes error and informational messages. The log is not cleared.
5 3 Retrieves array of error messages in last displayed order; excludes informational and action messages. The log is not cleared.

Factors

The following table outlines the proper order for each action related to this function and the corresponding function number.

Action Function
Open log. Function zero (0)
Start logging. Function one (1)
...run application N/A
Stop logging. Function two (2)
Retrieve log. Function five (5)
Clear log. Function three (3)
start logging Function one (1)
...run application N/A
...run application N/A
...run application N/A
...run application N/A
Stop logging. Function two (2)
Retrieve log. Function five (5)
Close log. Function four (4)

Note

  • A user task (the sm process) can have only one private message log at a time.
  • You cannot directly access message logs that are using other tasks.
  • A maximum of 500 logged messages is supported.

Examples

The following table describes a desired action and the syntax used to initiate the action.

Action desired Syntax
Open a log for 200 messages. $throwaway=messages(0,200)
Start logging $throwaway=messages(1)
Stop logging. $throwaway=messages(2)
Clear log. $throwaway=messages(3)
Close log. $throwaway=messages(4)
Retrieve all logged messages. $array=messages(5,0)
Retrieve all logged informational messages. $array=messages(5,1)
Retrieve all logged action messages. $array=messages(5,2)
Retrieve all logged error messages. $array=messages(5,3)