mirror of
https://github.com/vishapoberon/oberonbyexample.git
synced 2026-04-05 21:02:25 +00:00
intro to FOR
This commit is contained in:
parent
d50a785039
commit
56127663ea
2 changed files with 29 additions and 0 deletions
19
for/For.Mod
Normal file
19
for/For.Mod
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
MODULE for;
|
||||||
|
|
||||||
|
IMPORT Out;
|
||||||
|
|
||||||
|
VAR
|
||||||
|
i : INTEGER;
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
Out.String("i is "); Out.Int(i, 0); Out.Ln;
|
||||||
|
Out.String("For loop started"); Out.Ln;
|
||||||
|
FOR i := 0 TO 10 DO
|
||||||
|
Out.String("i : "); Out.Int(i, 0); Out.Ln;
|
||||||
|
END;
|
||||||
|
Out.String("For-By loop started"); Out.Ln;
|
||||||
|
FOR i := 0 TO 10 BY 2 DO
|
||||||
|
Out.String("i : "); Out.Int(i, 0); Out.Ln;
|
||||||
|
END;
|
||||||
|
END for.
|
||||||
10
for/Makefile
Normal file
10
for/Makefile
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
VOC = /opt/voc/bin/voc
|
||||||
|
|
||||||
|
all:
|
||||||
|
$(VOC) -m For.Mod
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm *.c
|
||||||
|
rm *.h
|
||||||
|
rm *.o
|
||||||
|
rm *.sym
|
||||||
Loading…
Add table
Add a link
Reference in a new issue