RosettaCodeData/Task/Variables/Modula-3/variables-1.mod3

16 lines
289 B
Plaintext

MODULE Foo EXPORTS Main;
IMPORT IO, Fmt;
VAR foo: INTEGER := 5; (* foo is global (to the module). *)
PROCEDURE Foo() =
VAR bar: INTEGER := 10; (* bar is local to the procedure Foo. *)
BEGIN
IO.Put("foo + bar = " & Fmt.Int(foo + bar) & "\n");
END Foo;
BEGIN
Foo();
END Foo.