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