![]() |
|
|
automac |
Longname: | auto matic mac ros | ![]() |
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Released: | 5.07a | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Created: | 5.07a | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See also: | trace event Expressions (n/a) |
Summary |
Allows macros to be run automatically without user intervention, when the assigned changes the macro is executed. Up to 5 expressions/macro pairs can be active at once. You can choose whether the expressions are checked when 3B2 is idle and/or during the execution of 3B2 scripts. Automatic macros can also be turned off (suspended) individually or all together. |
Example extract |
Suspend automatic macro 1
|
Syntax
|
-:L |
Turns automacro checking off. |
+:L |
Turns automacro checking on. |
idx:n |
A number from 1 to 5 representing one of the 5 automatic macros. |
expression:s |
The 3B2 expression, Expressions. |
last:n |
The last result of the 3B2 expression. (Not normally supplied, but appears in the dialogue box for information. By changing it to an abnormal value, you can force the corresponding macro to be executed the next time the expression is evaluated). |
macro:s |
The macro to be executed the next time the expression changes. As the whole macro must be in quotes, remember to double up any quotes that belong to the macro itself, for example:
|
mode:n |
Tells 3B2 when to check the expression for changes.
|
![]() |
The 5 automatic macros are global to 3B2, not document specific. If you are using them to start scripts in a document then that document must be 'active' to run the script. |
![]() |
An automatic macro is not guaranteed to be run every time the expression would have changed, only when the expression is actually evaluated and result is different from the last time it was evaluated. |
Illustrated below are some general syntax examples: |
Example |
This automatic macro executes a named script every 10 minutes.
|
Example |
Execute a numbered script when the top window changes:
|
Example |
Force execution of automatic macro 1 when its expression is next evaluated:
|
Example |
When Arbortext APP executes the macro, a single %d sequence can be replaced with the idx number of the macro. This can be used to pass the idx number to a script. The script can then use this number to suspend the automatic macro or otherwise. (The number is accessed from within the script using %b, a standard feature of trun) e.g.:
|
Example |
Reinstate automatic macro 1.
|
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. |
Document created on 08-Feb-2003 (revision 1)