intro to WHILE loop

This commit is contained in:
antranigv 2017-06-02 17:05:18 +04:00
parent 56127663ea
commit bb888c228e
No known key found for this signature in database
GPG key ID: 60686B14DAB81456
2 changed files with 27 additions and 0 deletions

10
while/Makefile Normal file
View file

@ -0,0 +1,10 @@
VOC = /opt/voc/bin/voc
all:
$(VOC) -m While.Mod
clean:
rm *.c
rm *.h
rm *.o
rm *.sym

17
while/While.Mod Normal file
View file

@ -0,0 +1,17 @@
MODULE while;
IMPORT Out;
VAR
i : INTEGER;
BEGIN
i := 0;
Out.String("WHILE loop started"); Out.Ln;
WHILE i < 10 DO
i := i + 1;
Out.Int(i, 0); Out.Ln;
END;
END while.