Hello World - A First Program


Below is the first program.

// hello.txt - a first program

generic hello
{
  hello()
  {
    h = "hello world"
    h.println()
  }
}

The program commences with a comment, which is denoted by a double slash.

The generic hello is declared. It contains a single method which is a constructor (constructors have the same name as the containing generic). Inside the constructor, a string called h is created and initialized with a string literal. The string is then printed to the console via the println() method.

To compile this program enter the dos console, change to the appropriate directory and issue the connand "generic hello.txt". To run the program type "run hello".

The class is stored in the code database. It may be listed via the command "show hello" - which lists the components of the class.