intro to CASE and ArgC

This commit is contained in:
antranigv 2017-06-08 10:39:00 +04:00
parent 9802b7e1fd
commit 95445d3d69
No known key found for this signature in database
GPG key ID: 60686B14DAB81456
2 changed files with 24 additions and 0 deletions

14
case/Case.Mod Normal file
View file

@ -0,0 +1,14 @@
MODULE case;
IMPORT Out, Modules;
BEGIN
CASE Modules.ArgCount - 1 OF
0 : Out.String("There are no arguments");
| 1 : Out.String("There is one argument");
| 2 : Out.String("There are two arguments");
ELSE Out.String("There are more than two arguments") END;
Out.Ln;
END case.

10
case/Makefile Normal file
View file

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