Geas MUD, enter the Aventure!
Geas Home | Play the Game

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2.9 Conditionals

Conditional statements are used a lot in LPC, and there is several ways of writing them. A very important concept is that 0 is considered as false and any other value as true in tests. This means that empty listings ({}), empty strings "" and empty mappings ([]) also are evaluated as true since they aren't 0. You have to use special functions to compute their size or determine content if you want test them, more about that later however. The if/else statement  The common if/else statement The switch statement The ?: expression  The ?: statement

This document was generated by Ronny Wikh on July, 8 2003 using texi2html