Difference between revisions of "Hello World/en"

From vishap oberon compiler
Jump to navigation Jump to search
(Created page with "Now let's write a "hello world" program and compile it using voc. Create a new file named <code>foo.Mod</code> and insert in it the following code. <pre> MODULE hello; IMPO...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
{{delete| այս էջը արդէն աւելորդ է, կարող ենք ջնջել։}}
 +
 
Now let's write a "hello world" program and compile it using voc.
 
Now let's write a "hello world" program and compile it using voc.
  
Line 11: Line 13:
  
 
Console.String ("Hello World!");
 
Console.String ("Hello World!");
Console.Ln;
+
Console.Ln
  
 
END hello.
 
END hello.

Latest revision as of 03:16, 5 December 2014

Template:Delete

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;

BEGIN

Console.String ("Hello World!");
Console.Ln

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.