Manual:DIL Manual/if()

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 13:08, 27 May 2020 by Nove (talk | contribs) (XML import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


if:
    The if statement is much like C. It takes any type as
    argument. Non integers are considered 'TRUE' if they are
    not null.
Example:

   dilbegin foo();
   code
   {
     if (self.hp>10)
     {
       exec("say Hehe!",self);
     }
     else
     {
       exec("say ouch!", self);
     }
   }
   dilend
Example:

   dilbegin foo();
   code
   {
     if (self.loaded>10)
     {
       exec("say its getting crowded!",self);
     }
   }
   dilend
Example:

   dilbegin foo();
   code
   {
     if (self.loaded<10)
       exec("say plenty of room!",self);
   }
   dilend
---~---~---~---~---~---~---~---~---