mirror of
https://github.com/vishapoberon/oberonbyexample.git
synced 2026-04-06 05:12:25 +00:00
example contributed by pdewacht.
This commit is contained in:
parent
9802b7e1fd
commit
37682dfdaf
6 changed files with 60 additions and 0 deletions
22
enums_example/1/test.Mod
Normal file
22
enums_example/1/test.Mod
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
MODULE test;
|
||||
|
||||
IMPORT Days, Out;
|
||||
|
||||
VAR today, yesterday, tomorrow: Days.Day;
|
||||
|
||||
BEGIN
|
||||
today := Days.mon; (*init*)
|
||||
|
||||
yesterday := Days.Prev(today);
|
||||
IF yesterday = Days.sun
|
||||
THEN
|
||||
Out.String("it works!"); Out.Ln
|
||||
END;
|
||||
tomorrow := Days.Next(today);
|
||||
|
||||
IF tomorrow = Days.tue
|
||||
THEN
|
||||
Out.String("it works!"); Out.Ln
|
||||
END;
|
||||
|
||||
END test.
|
||||
Loading…
Add table
Add a link
Reference in a new issue