Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The Program Namespace

The Program namespace provides runtime operations.

The currently implemented member is:

Program.Stop();

This terminates the program by calling the C exit function with a status of 0.

Program.Stop() is treated as a namespace operation rather than a normal user-defined function call.

The semantic analyzer checks that:

  • It is used inside a function
  • It has zero arguments
  • The namespace and operation are valid

Example:

Open Nunction Main()
{
    Print("before");
    Program.Stop();
    Print("after");
}

The second Print is never reached.


← Previous Next →