my 1st ever try if; elseif; else; . jack
if (1 == 1) {
eatnicefood
} elseif (1 == 2) {
eatnicerfood
} else {donteatnicefood {
}
Exitprocess(0);
jack.
A community discussion post from the original code:zIRON forum.
if (1 == 1) {
eatnicefood
} elseif (1 == 2) {
eatnicerfood
} else {donteatnicefood {
}
Exitprocess(0);
jack.
first problem i see is you did not use
[code]your code here
[/code]
ok at your code, your else has a small problem:
} else {donteatnicefood {
should be
} else {
donteatnicefood
}
and then remove the final }
take a look here "Control Structures" for more info.
if (1 == 1) {
eatnicefood
} elseif (1 == 2) {
eatnicerfood
} else {
donteatnicefood
}
Exitprocess(0);
EDIT by Admin - added code block
jack.
when posting code, put it inside
[code]
[/code] brackets
ps if you want to see some visual output for testing
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');
}
il use:
program WIN32CUI 'test';
#include 'ch.zir';
if (1 == 1) {
eatnicefood
} elseif (1 == 2) {
eatnicerfood
} else {
donteatnicefood
}
Exitprocess(0);
jack.