$ZTRIgger()

Examine or load trigger definition. The format of the $ZTRIGGER() function is:

$ZTRIgger(expr1[,expr2]) 
[Note] 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.

Examples of $ZTRIGGER()

Example:

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.

Example:

GTM>set trigstr="+^a -commands=S -xecute=<<"_$c(10)_" do ^twork1"_$c(10)_" do ^twork2"_$c(10) write $ztrigger("item",trigstr)

This example demonstrates the usage of the $ztrigger("ITEM",<multi-line-trigger-definition>> where <<denotes the definition of a multi-line -XECUTE string and $c(10) to denote the newline separator. Unlike the $ztrigger("FILE") form, $ztrigger("ITEM",<multi-line-trigger-definition>> does not require the trigger definition to terminate with >>.

Example:

GTM>write $ztrigger("file","agbl.trg")
1
GTM>

This example is equivalent to the previous $ztrigger("ITEM") example. In this example, agbl.trg contains the following multi-line trigger definition:

+^a -commands=S -xecute=<<
 do ^twork1
 do ^twork2
>>

Unlike $ztrigger("ITEM"), $ztrigger("FILE") usages require the trigger definition to terminate with >>