Editing from GT.M

If you focus on program development outside the GT.M environment, skip the next and continue with the section "Editing from DCL".

To create and edit a source program in GT.M, invoke Direct Mode. The method you customarily use to invoke Direct Mode depends upon your programming environment. However, in most cases, you can invoke Direct Mode by entering either GTM or MUMPS/DIRECT_MODE at the DCL prompt. GTM is a VMS symbol, which by default is defined to be MUMPS/DIRECT. Once you are at the GTM> prompt, invoke the editor by entering ZEDIT "filename". ZEDIT invokes a TPU-based editor selected by the logical name TPU$SECTION.

You can create your own customized executable images and set the symbol GTM to invoke your image. For more detailed information about TPU-based editors refer to the VMS Guide to Text Processing. For instructions for customizing an editor to meet specific standards or needs, refer to the VMS TPU Reference Manual.

Invoke Direct Mode to create and edit a source program in GT.M. At the GTM> prompt, invoke the editor by typing:

ZEDIT <filename>

The TPU editor invoked by ZEDIT creates a separate RMS file for each M source module. When you make changes to an existing routine file and save them, the editor creates a new version of the routine file. The system manager typically controls the number of versions of a file that may be stored on disk. The version limit ranges from one to unlimited. The ability to save previous versions of a routine serves as a valuable tool in managing application development and maintenance.

The GT.M environment works more efficiently if the file has the same name as the M routine it contains, and if it has a file type of .M. Because ZEDIT automatically defaults to the file type .M, ZEDIT commands generally do not specify the file type. If you use other file types, you must specify the type with every reference to of the file.

Example:

        $ GTM
        GTM>ZEDIT "PAYROLL"
        

This syntax uses the GTM symbol to enter GT.M from DCL, and uses ZEDIT to initiate an editing session on PAYROLL.M Because ZEDIT defaults the extension to .M, it is not necessary to provide an extension. If PAYROLL.M does not already exist, GT.M creates it in the first source directory identified by $ZROUTINES. If $ZROUTINES is null, ZEDIT places the source file in the process's current default directory.

$ZROUTINES is a read-write special variable containing an ordered list of VMS directories that certain GT.M functions use to locate source and object files. Generally, a system manager sets up the environment to define the logical name GTM$ROUTINES. At image invocation, GT.M initializes $ZROUTINES to the value of GTM$ROUTINES. Once you are running M, you can SET and refer to $ZROUTINES using the format:

          GTM>SET $ZROUTINES=expr
        

Where:

For more information on $ZROUTINES, refer to the "Intrinsic Special Variables" chapter in this manual.