(* Modula-2 on XDS Modula-2 *) (* mod2\console.prj *) MODULE ConsoleApp1; FROM IO IMPORT WrStr, WrLn, WrInt, RdKey; IMPORT Window; (* TopSpeed tool*) PROCEDURE openTxtWin(VAR W1: Window.WinType); VAR WD : Window.WinDef; BEGIN WITH WD DO X1 := 0; Y1 := 0; X2 := 79; Y2 := 24; Foreground := Window.White; Background := Window.Blue; CursorOn := TRUE; WrapOn := TRUE; Hidden := FALSE; FrameOn := TRUE; FrameDef := Window.SingleFrame; FrameFore := Window.LightMagenta; FrameBack := Window.Cyan; END; W1 := Window.Open(WD); END openTxtWin; VAR i1, i2, i3: INTEGER; i : INTEGER; W1 : Window.WinType; ch : CHAR; CONST imax = 6; BEGIN openTxtWin(W1); WrStr("Fibonacci's series is "); i1 := 1; i2 := 1; WrInt(i1,1); WrStr(", "); WrInt(i2,1); WrStr(", "); FOR i := 1 TO imax DO i3 := i1 + i2; WrStr(", "); WrInt(i3,1); i2 := i1; i1 := i3; END; WrStr(", Done!"); WrLn; ch:= RdKey(); Window.Close(W1); END ConsoleApp1.