Hello World/en

From vishap oberon compiler
Revision as of 00:07, 24 November 2014 by Antranigv (talk | contribs) (HINT: no need for ; after Console.Ln)
Jump to navigation Jump to search

Now let's write a "hello world" program and compile it using voc.

Create a new file named foo.Mod and insert in it the following code.

MODULE hello;

IMPORT Console;


Console.String ("Hello World!");

END hello.

Which means

MODULE hello — The module's name is hello.

IMPORT Console — Import the module Console.

BEGIN — Here we start our code!

Console.String ("Hello World!"); — Module Console, Procedure String (which is going to show a sting on our console) Hello World!
Console.Ln; — Print a line on the Console.

END hello. — End of the module hello, and let's not forget the dot. (:

Now let's compile it!

voc -m foo.Mod

and now let's run it!

$ ./hello
Hello World!


End article.