Examples of $ZPID()

The examples in this section illustrate the previous verbal description of $ZPID().

Example :

    $ GTM
    GTM> WRITE $ZPID(1)
    %GTM-E-ZPIDBADARG,
    The tvexpr must be FALSE if the last ZPID not found
    GTM>       
    

This $ZPID() attempts to get the next PID without getting the first PID and, therefore, generates an error.

Example:

    S pid=$ZPID(0) F Q:pid="" D SHWPRC(pid) S pid=$ZPID(1)
    

This uses a $ZPID() loop to examine all accessible processes. The logic is analogous to that in a $ORDER() loop. If this routine runs without the VMS WORLD privilege, it may not "see" all processes.