Examine or load trigger definition. The format of the $ZTRIGGER() function is:
$ZTRIgger(expr1
[,expr2
])
$ZTRIGGER() returns a truth value (1 or 0) depending on the success of the specified action.
$ZTRIGGER() performs trigger maintenance actions similar those performed by MUPIP TRIGGER.
set trigstr="+^a -xecute=<< -commands=S"_$char(10)_" do ^twork1"_$char(10)_" do ^twork2"_$char(10) write $ztrigger("item",trigstr) set trigstr="+^a -xecute=<< -commands=S "_$c(10)_" do ^twork1"_$c(10)_" do ^twork2"_$c(10) write $ztrigger("item",trigstr)
GT.M maps trigger definitions to the region to which they apply.
Note | |
---|---|
A $ZTRIGGER() action (delete or select) applies to all triggers in all regions matching the specified signature. If the argument specifies an incomplete trigger signature, for example, only the name, the specification may match multiple triggers and apply the delete or select to all of them. FIS recommends you run a select and analyze the scope of the signature before any signature limited delete. |
GTM>set X=$ztrigger("S") GTM>
This example displays the current trigger definitions stored in the database.
GTM>set X=$ztrigger("i","+^Acct(sub=:) -command=set -xecute=""set ^X($ztvalue)=sub""") GTM>
This example adds a trigger definition for the first level node of ^Acct.
GTM>set trigstr="+^a -commands=S -xecute=<<"_$c(10)_" do ^twork1"_$c(10)_" do ^twork2"_$c(10) write $ztrigger("item",trigstr)
GTM>write $ztrigger("file","agbl.trg") 1 GTM>
+^a -commands=S -xecute=<< do ^twork1 do ^twork2 >>