Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
HariKari
Wanderer


Joined: 16 Feb 2001
Posts: 57

PostPosted: Sun Feb 10, 2002 8:44 am   

Else IF
 
Is there any way to do else if's other than the nested #if commands?

The only other way I can think of is
#if (...) {blah;#ab 1}
#if (...) {...else if...;#ab 1}
...else...
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Feb 10, 2002 2:01 pm   
 
Nope, zMUD doesn't have an actual elseif command, so you can only do it by putting another #IF inside the else part of the original #IF.

Kjata
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Feb 11, 2002 1:51 am   
 
quote:

Is there any way to do else if's other than the nested #if commands?

The only other way I can think of is
#if (...) {blah;#ab 1}
#if (...) {...else if...;#ab 1}
...else...





#CASE is about as close as you can get, if all your conditions hinge around the same comparison (ie, %random(1,3)).

Nested #IFs are as close as you can get if you have multiple conditions or if other conditions rely on the outcome of previous conditions.

#IF (mob = alive) {
#if (mob != human) {
#if (mob = ork|hamster of doom|warlord of Candyland) {attack} {don't attack}
} {don't attack, it's human}
} {don't attack, it's dead}

li'l shmoe of Dragon's Gate MUD
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net