intro to variables

This commit is contained in:
antranigv 2017-06-02 14:45:27 +04:00
parent 52d6d3808b
commit 2629af8bbb
No known key found for this signature in database
GPG key ID: 60686B14DAB81456
2 changed files with 41 additions and 0 deletions

10
variables/Makefile Normal file
View file

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

31
variables/Variables.Mod Normal file
View file

@ -0,0 +1,31 @@
MODULE variables;
IMPORT Out;
VAR
s : ARRAY 32 OF CHAR;
i : REAL;
n, m : INTEGER;
BEGIN
s := "Initial";
Out.String(s); Out.Ln;
i := 3.14;
n := 64;
m := 42;
Out.Int(m, 0); Out.Ln;
Out.Int(n, 0); Out.Ln;
Out.Real(i, 0); Out.Ln;
s := "assigning new values";
Out.String(s); Out.Ln;
i := 2.71;
n := 128;
m := 84;
Out.Int(m, 0); Out.Ln;
Out.Int(n, 0); Out.Ln;
Out.Real(i, 0);
Out.Ln
END variables.