[Table of contents] [Your First Modula-3 program]

Introduction to programming in Modula-3

Although Modula-3 is a descendant of the Pascal family of languages it also has some characteristics which will be familiar to C/C++programmers.

Case is significant
All keywords and reserved words must be in uppercase letters. Identifiers such as variables, constants, and procedure names must always appear in the same case as the one used in the definition. For example, Main and main are two different dentifiers.
Single main module
Every Modula-3 program must have one and only one main module. For small programs, the main module may be the only module.
Comments
Comments are of the form "(* comment *)" and may expand several lines.
BEGIN/END for code blocks
Code blocks are done by enclosing the code in a matched set of BEGIN/END. One important point to notice is that for a procedure the END must be followed by the name of the procedure.
Semi-colon separate statements
Each statement must be separated by a semi-colon.
Sources in ./src
All of the Modula-3 programs must be located in a subdirectory called src from the directory where the compiler will be called. The result program will be saved in a directory off the current directory and named the name of the operating sytem currently running.

[Table of contents] [Your First Modula-3 program]