FROM IO IMPORT WrStr, WrLn, RdCard, WrCard, RdInt, WrInt; (* import general procedures *)
VAR ...; (* variable-declarations *)
BEGIN
WrLn;
...
END ModuleName.
FROM IO IMPORT WrStr, WrLn, RdCard, WrCard, RdInt, WrInt; (* import general procedures *)
CONST = ; (* constants *)
VAR ...; (* variable-declarations *)
BEGIN
WrLn;
...
END ModuleName.
MODULE ModuleName;
<* WOFF + *> <* NOOPTIMIZE + *>
FROM IO IMPORT WrStr, WrLn, RdCard, WrCard, RdInt, WrInt,
RdKey, RdLn;
FROM Lib IMPORT Delay; (* Delay: let the program wait a
little time *)
(* de wimdows library vind je onder
parallel.vub.ac.be > Education > Modula-2 > Technology *)
FROM Wimdows IMPORT Window, KillWindow, Text,
SetFont, GetKey,
Rectangle, Circle, Line, Disc;
FROM Wimdows IMPORT _clrBLACK, _clrBLUE,
_clrGREEN, _clrCYAN, _clrRED, _clrMAGENTA;
FROM Wimdows IMPORT _clrBROWN, _clrWHITE,
_clrGRAY, _clrLIGHTBLUE, _clrLIGHTGREEN;
FROM Wimdows IMPORT _clrLIGHTCYAN,
_clrLIGHTRED, _clrLIGHTMAGENTA, _clrLIGHTYELLOW, _clrBRIGHTWHITE;
VAR
x:CARDINAL;
BEGIN
(* Initialise
graphics
*)
Window("titel", 500, 500);
(* tell user to press a
key to finish the program... *)
SetFont(1, _clrRED);
Text("press any key to finish the program", 135, 10);
(* ...and program will
wait here until user presses a key *)
x := GetKey();
(* finally close the
window *)
KillWindow();
END ModuleName.
CONST (* constants *)
VAR (* variable-declarations *)
BEGIN
WrLn;
END ModuleName.
MODULE ModuleName;
<* WOFF + *> <* NOOPTIMIZE + *>
FROM IO IMPORT RdChar, WrChar, WrStr, RdStr, WrLn, RdKey,
RdLn, RdCard, WrCard, RdInt, WrInt, RdReal, WrReal;
FROM Lib IMPORT Delay; (* Delay: let the program wait a
little time *)
(* de wimdows library vind
je onder parallel.vub.ac.be > Education > Modula-2 >
Technology *)
FROM Wimdows IMPORT Window, KillWindow,
GetKey,
SetFont, Text, Rectangle, Circle, Disc, Line, Polygon;
FROM Wimdows IMPORT _clrBLACK, _clrBLUE,
_clrGREEN, _clrCYAN, _clrRED, _clrMAGENTA;
FROM Wimdows IMPORT _clrBROWN,
_clrWHITE, _clrGRAY, _clrLIGHTBLUE, _clrLIGHTGREEN;
FROM Wimdows IMPORT _clrLIGHTCYAN,
_clrLIGHTRED, _clrLIGHTMAGENTA, _clrLIGHTYELLOW, _clrBRIGHTWHITE;
CONST SCREEN_SIZE = 600; (* constants *)
VAR
x:CARDINAL;
BEGIN
(* Initialise graphics *)
Window("titel", SCREEN_SIZE, SCREEN_SIZE);
(* tell user to press a
key to finish the program... *)
SetFont(1, _clrRED);
Text("press any key to finish the program", SCREEN_SIZE/2-120,
10);
(* ...and program will
wait here until user presses a key *)
x := GetKey();
(* finally close the
window *)
KillWindow();
END ModuleName.
CONST (* constants *)
VAR (* variable-declarations *)
BEGIN
WrLn;
END ModuleName.
CONST (* constants *)
TYPE
(* PROCEDURE ( : ; : ): ;
VAR result: ;
BEGIN
RETURN result;
END ;*)
VAR (* variable-declarations *)
BEGIN
WrLn;
END M.
MODULE M;
<* WOFF + *> <* NOOPTIMIZE + *>
FROM IO IMPORT RdChar, WrChar, WrStr, RdStr, WrLn,
RdLn, RdCard, WrCard, RdInt, WrInt, RdReal, WrReal, WrFixReal, RdBool,
WrBool, RdKey, KeyPressed;
FROM RealMath IMPORT sqrt, exp, sin, cos, tan,
arcsin, arccos, arctan, power, round, pi;
FROM Lib IMPORT Delay; (* Wait n milliseconds *)
FROM Wimdows IMPORT Window,
KillWindow, GetKey, SetFont, Text, Line, Rectangle,
Circle, Disc, Polygon,
_clrBLACK, _clrBLUE, _clrGREEN, _clrCYAN, _clrRED, _clrMAGENTA;
FROM Wimdows IMPORT
_clrBROWN, _clrWHITE, _clrGRAY, _clrLIGHTBLUE, _clrLIGHTGREEN,
_clrLIGHTCYAN, _clrLIGHTRED, _clrLIGHTMAGENTA, _clrLIGHTYELLOW,
_clrBRIGHTWHITE;
CONST SCREEN_SIZE = 600; (*
constants *)
VAR x:
CARDINAL;
(* variable-declarations *)
BEGIN
WrLn;
Window("titel",
SCREEN_SIZE, SCREEN_SIZE);
(* tell user to press a
key to finish the program... *)
SetFont(1, _clrRED);
Text("press any key to finish the program", SCREEN_SIZE/2-120,
10);
(* ...and program will
wait here until user presses a key *)
x := GetKey();
(* finally close the
window *)
KillWindow();
END M.
CONST (* constants *)
TYPE
(* PROCEDURE ( : ; : ): ;
VAR toReturn: ;
BEGIN
RETURN toReturn;
END ;*)
VAR (* variable-declarations *)
BEGIN
WrLn;
END M.
Back to the top -- Back to exercises index