Examples of $TEXT()

Example:

    F i=1:1 S x=$T(+i) Q:x="" W !,x
    

This loop uses $TEXT() to write out the entire source for the current routine.

Example:

    GTM> WRITE $TEXT(+0)
    GTM$DMOD
    GTM> WRITE $TEXT(+1)
    GTM>
    

This uses $TEXT() to WRITE the name of the current routine, then it tries to access the source and returns an empty string. This occurs because the default Direct Mode image is compiled by Sanchez and delivered without source. The exact failure message may vary.