Skip to content

Chapter3.Development Cycle

Chapter3.Development Cycle

Table of Contents

Overview of the Program Development Cycle

Defining Environment Variables
gtm_dist

gtmgbldir

gtm_principal

gtmroutines

Editor

Preparing the Database

Creating and Editing a Source Program
Editing from GT.M

Editing from the Shell

Compiling a Source Program
Compiling from GT.M

Compiling from the Shell

Qualifiers for the mumps command

Executing a Source Program
Executing in Direct Mode

Locating the Source File Directory

Executing from the Shell

Processing Errors from Direct Mode and Shell

This chapter introduces program development in the GT.M environment. The GT.M environment differs from other M implementations in a number of ways. These differences, which include maintaining data and code in separate files and compiling rather than interpreting source code, allow greater programmer control over the development cycle.

In contrast to M environments that interpret M code, GT.M compiles M code from source files into the target machine language. The GT.M compiler produces object files, which are dynamically linked into an image. Source files and object files may be managed independently, or placed together in a specific directory. GT.M permits access to source and object files in multiple directories.

GT.M databases are UNIX files identified by a small file called a Global Directory. Global Directories allow management of the database files to be independent of the placement of files containing M routines. By changing the Global Directory, you can use the same programs to access different databases.

Program development may utilize both GT.M and UNIX development tools. The development methodology and environment chosen for a particular installation, and tailored by the individual user, determines the actual mix of tools. These tools may vary from entirely GT.M with little UNIX, to mostly UNIX with a modest use of GT.M.

Direct Mode serves as an interactive interface to the GT.M run-time environment and the compiler. In Direct Mode, the user enters M commands at the GT.M prompt, and GT.M compiles and executes the command. This feature provides immediate turnaround for rapid program development and maintenance.

This chapter is based on the tasks that a programmer might perform while developing an application. It provides a “road map” for programmers of varying levels. Some steps may be unnecessary in your environment, so feel free to skip sections that do not apply to your situation.