From 56127663ea044ef58ede57feacd16cb08d4b5be4 Mon Sep 17 00:00:00 2001 From: antranigv Date: Fri, 2 Jun 2017 16:58:22 +0400 Subject: [PATCH] intro to FOR --- for/For.Mod | 19 +++++++++++++++++++ for/Makefile | 10 ++++++++++ 2 files changed, 29 insertions(+) create mode 100644 for/For.Mod create mode 100644 for/Makefile diff --git a/for/For.Mod b/for/For.Mod new file mode 100644 index 0000000..9fd8ba5 --- /dev/null +++ b/for/For.Mod @@ -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. diff --git a/for/Makefile b/for/Makefile new file mode 100644 index 0000000..1cbbc4d --- /dev/null +++ b/for/Makefile @@ -0,0 +1,10 @@ +VOC = /opt/voc/bin/voc + +all: + $(VOC) -m For.Mod + +clean: + rm *.c + rm *.h + rm *.o + rm *.sym