ZPrint

The ZPRINT command displays the source code lines selected by its argument.

The format of the ZPRINT command is:

ZP[RINT][:tvexpr][entryref[:label[+intexpr]][,...]

Note that the routinename may only appear before the colon (:) delimiter. The integer expression offsets may be positive or negative, but they must always be delimited by a plus sign (+).

For more information on entryrefs, refer to Chapter 5: “General Language Features of M.

Examples of ZPRINT

Example:

GTM>ZPRINT X^RTN

This example displays the line beginning with the label X in the routine RTN.

Example:

GTM>ZPRINT X^RTN:X+5
    
GTM>ZPRINT X+-5^RTN:X
GTM>ZPRINT X^RTN:X+-5^RTN

The first line displays the line beginning with the label X and the next 5 lines in routine RTN. The second line displays the 5 lines preceding label X in the same routine and the line beginning with label X. The third line generates a run-time error because the routine name must appear only before the colon in the argument.

Example:

GTM>zprint ^A#1#
 do ^test1
 do stop^test2
GTM>

This command displays the trigger code for trigger name A#1#.

ZPRINT ^x#/BREG : Print trigger routine user-named "x" in region BREG
ZPRINT ^x#1#/BREG : Print trigger routine auto-named "x#1" in region BREG
ZPRINT ^x#1#A/BREG : Print trigger routine auto-named "x#1", runtime disambiguated by "#A", AND in region BREG
ZPRINT +1^x#1#A/BREG : Print line 1 of trigger routine auto-named "x#1", runtime disambiguated by "#A", AND in region BREG

These are some examples of disambiguator combinations.