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

avatar

(send private message)

Posts: 923
Topics: 54

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 533, May 5, 2016, 7:19 am.


Statistics:
Threads: 223 | Posts: 1835 | Members: 50 | Active Members: 50
Welcome to our newest member, NobodyAtWork
const Copyright = '2011-2017 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd