Register | Login
Forum Index > Samples > Enum sample
Author Message
Pages: 1
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[74] Enum sample - posted: 2011-10-08 22:23:36
small sample showing the basics of enumeration

Code:
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:

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


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 2 user(s) online. 0 member(s) and 2 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd