![]() |
![]() |
![]() |
![]() |
$push and $pop
Synopsis
Description
$push delays the delivery of events until a $pop command. In this way, an object's functions will not execute until the $pop.
The how clause indicates the execution state for the scope of the command:
-prog Program state (default state)
For more information on state, see $print, $dprint, $save, and $save_usr .
$pop ends the most recent $push command and causes the delayed events to be delivered.
$push and $pop commands can be nested.
Examples
The following example uses add_num, an example object whose method adds subobjects src_1 and src_2 and places the result in subobject res:
OM(SingleWindowApp) -> USER.add_num add_num1;
OM(SingleWindowApp) -> add_num1 {
OM(add_num1) -> src_1 = 1.0;
OM(add_num1) -> src_2 = 2.0;
OM(add_num1) -> $float res
3.000000
OM(add_num1) -> src_1 = 4.0;
OM(add_num1) -> $float res
6.000000
OM(add_num1) -> $push
OM(add_num1) -> src_1 = 10;
OM(add_num1) -> $float res
6.000000
OM(add_num1) -> $pop
OM(add_num1) -> $float res
12.000000.
![]() |
![]() |
![]() |
![]() |