![]() |
|
event |
Longname: | event | ![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
Released: | 5.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Created: | 5.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See also: | automac |
Summary |
The event macro is only useful in 3B2OCX where communication between 3B2 and the enclosing application is required. |
Example extract |
You can pass your own events from 3B2 using the event macro:
|
Syntax
|
event_number:n event_param:n
|
event_number:n |
User defined event number. 3B2 issues a number of events automatically i.e. for each page printed or formatted (see api.txt in the OCX install directory). |
event_param:n |
A parameter of the event sent to and used by the OCX wrapper application to action whatever it may be configured to do. This number can be generated by a number of means in 3B2 including, but not exclusively, getvars, script variables or expressions. |
There are two main reason for 3B2 to issue an event to the enclosing application: |
|
![]() |
When using user defined events like the example, you need to make sure that these do not clash with 3B2's predefined events, from api.txt: |
|
Currently (version 8) 3B2 uses the following event identifiers: |
|
Example |
This advanced example is executed by the templates autoexec. v21812 is the script line number, v1818 is the script name. Each time one of them change, 3b2 increase the variables (respectively) _AX_P_ and _AX_S_ and sends the comment event 600 or 601 with the variable value as parameter.
Adventtest.exe (the sample wrapper program delivered with 3B2 ocx builds) displays the event number and the event parameter it receives from 3b2 (eg. event 600,1 would show 600 in the first field and 1 in the second, at the bottom left of the window). However, up to its version 2.3, it does not display the number of received events in any manner, so the only way to see, on screen, consecutive events with identical numbers, is to change their parameters. Hence the slightly unusual sample seen here. |
![]() |
For further information see also: |
Perl3B2::event (a way to send events from perl scripts as Perl3B2::macro(event X, Y) is no longer stable). |
api.txt - ships with the OCX version. |
ACS documentation, ACS relies heavily on events for logs (Advent3B2::ACS perl package). |
Document created on 08-Feb-2003 (revision 1)