Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Samples

Enum sample

A community discussion post from the original code:zIRON forum.

Colin admin
Posts
928
Threads
49
Location
Bulgaria

Enum sample

small sample showing the basics of enumeration

program WIN32CUI 'Sample';

#include 'console.zir';
#include 'ch.zir';

//////////////////////////////

enum DayOfWeek {
	Monday = 1, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday,
}

DayOfWeek Today = Sunday;

if (Today > Friday) {
	print('Today is a week-end day!\r\n');
} else {
	print('Today is a week-day!\r\n');
}

wait_key(nil);

ExitProcess(0);

the above code will output:

Today is a week-end day!
Press any key to continue