Go to the first, previous, next, last section, table of contents.

The Main Module

Every Modula-3 program must have a single main module. For small programs, the main module may be the only module. Here is a short example.

MODULE Main;

IMPORT IO; (* So we can print things *)

VAR name: TEXT;  (* a string called `name' *)

BEGIN
  IO.Put("Enter your name: ");
  name := IO.GetLine();
  IO.Put("Your name is: " & name & "\n");
END Main.


Go to the first, previous, next, last section, table of contents.