SessionPrint Event 526
Applies To: | Session |
Description
If enabled, this event is reported when a value is about to be displayed in the Session. It is generated by the display of a variable or the result of a function including system variables and functions. Error messages and output from system commands do not generate this event.
The event message reported as the result of ⎕DQ
, or supplied as the right argument to your callback function, is a 2-element vector as follows :
[1] |
Object | ref or character vector |
[2] |
Event | 'SessionPrint' or 526 |
The attachment of a callback function intercepts and annuls the normal display of any value.
Note that this event may be extended in future; in particular the number of elements in the event message may be increased, and the event may be generated by some system commands. You should therefore allow for such extensions in any code which refers to SessionPrint.
When the event is generated, the left argument of the callback function contains the value which was about to be displayed. The callback function may display this or any other value, using default output or by assignment to ⎕
. If so, this output will be processed normally, without generating a subsequent SessionPrint event. If the callback fails to explicitly display anything, nothing will appear in the Session.
Example
⎕VR'⎕SE.TimeStamp'
∇ VAL TimeStamp EV
[1] ⎕TS VAL
∇
'⎕SE'⎕WS'Event' 'SessionPrint' '⎕SE.TimeStamp'
2
2014 9 18 16 20 38 318 2
⎕A
2014 9 18 16 20 44 668 ABCDEFGHIJKLMNOPQRSTUVWXYZ
The result (if any) of the callback function is ignored.
You may not disable the event (by setting its action to ¯1
), nor generate the event using ⎕NQ
, nor call it as a method.