Register | Login
Forum Index > Source Help > my 1st ever try if; elseif; else; . jack
Author Message
Pages: 1
jackel
Member
(send private message)

Posts: 19
Topics: 6

Location:
[1333] my 1st ever try if; elseif; else; . jack - posted: 2013-02-17 04:35:18
if (1 == 1) {
eatnicefood
} elseif (1 == 2) {
eatnicerfood
} else {donteatnicefood {

}

Exitprocess(0);



jack.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1334] - posted: 2013-02-17 14:10:12
first problem i see is you did not use Code:
[code]your code here[/code]


ok at your code, your else has a small problem:

Code:
} else {donteatnicefood {


should be

Code:
} else {
   donteatnicefood
}


and then remove the final }

take a look here "Control Structures" for more info.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
jackel
Member
(send private message)

Posts: 19
Topics: 6

Location:
[1335] - posted: 2013-02-17 14:34:54
Code:
if (1 == 1) {
  eatnicefood
} elseif (1 == 2) {
  eatnicerfood
} else { 
  donteatnicefood 
}

Exitprocess(0);


EDIT by Admin - added code block

jack.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1336] - posted: 2013-02-17 14:56:00
when posting code, put it inside Code:
[code][/code]
brackets

ps if you want to see some visual output for testing

Code:
if (1 == 1) {
  print('eat nice food\r\n');
} elseif (1 == 2) {
  print('eat nicer food\r\n');
} else { 
  print('don\'t eat nice food\r\n');
}


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
jackel
Member
(send private message)

Posts: 19
Topics: 6

Location:
[1337] - posted: 2013-02-17 15:12:10
il use:

Code:
program WIN32CUI 'test';
#include 'ch.zir';

  if (1 == 1) {
  eatnicefood
} elseif (1 == 2) {
  eatnicerfood
} else { 
  donteatnicefood 
}

Exitprocess(0); 


jack.
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 1 user(s) online. 0 member(s) and 1 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