From 95445d3d694ca5c7d7d6f2e27f8d6ba0e52d0f91 Mon Sep 17 00:00:00 2001 From: antranigv Date: Thu, 8 Jun 2017 10:39:00 +0400 Subject: [PATCH] intro to CASE and ArgC --- case/Case.Mod | 14 ++++++++++++++ case/Makefile | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 case/Case.Mod create mode 100644 case/Makefile diff --git a/case/Case.Mod b/case/Case.Mod new file mode 100644 index 0000000..2f6fb31 --- /dev/null +++ b/case/Case.Mod @@ -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. diff --git a/case/Makefile b/case/Makefile new file mode 100644 index 0000000..001cdd7 --- /dev/null +++ b/case/Makefile @@ -0,0 +1,10 @@ +VOC = /opt/voc/bin/voc + +all: + $(VOC) -m Case.Mod + +clean: + rm *.c + rm *.h + rm *.o + rm *.sym