Difference between revisions of "Nothing/en"

From vishap oberon compiler
Jump to navigation Jump to search
(Created page with "An Oberon program consists of the word MODULE, then the name you choose to call the program followed by declarations, if any, of special things you wish to use in the program,...")
 
Line 21: Line 21:
  
 
That's all folks!
 
That's all folks!
 +
 +
''You may want also to learn how to write a "Hello World" program in Oberon ==> [[Hello World/en|Hello World tutorial]]''

Revision as of 14:02, 24 November 2014

An Oberon program consists of the word MODULE, then the name you choose to call the program followed by declarations, if any, of special things you wish to use in the program, then BEGIN followed by the program instructions, then END followed by the name of the program and a period. All words that are a permanent part of Oberon-2 must be capitalized.

The simplest program which does nothing is:

MODULE nothing;
BEGIN
END nothing.

So let's open an editor and write that down and save it as nothing.Mod and compile it using voc.

$ voc -m nothing.Mod

We will get an executable file named nothing.

Let's run it by

./nothing

and nothing happens because the program does nothing.

That's all folks!

You may want also to learn how to write a "Hello World" program in Oberon ==> Hello World tutorial