Manual:DIL Manual/Expressions

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 14:14, 29 June 2020 by Nove (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Expressions:

  The expressions used in assignment can return any
  of the types you can declare variables. Also they might return
  fail or null. An expression returning fail will not result
  in any action being taken. Fail is returned when you
  request a field from a null pointer, or the like.
Example:

   dilbegin foo();
   var
     myvarsl : stringlist;
     myvars : string;
     myvarint : integer;
     myvaredp : extraptr;
     myvarunit : unitptr;
   code
   {
     :start:
     myvarunit := self.inside.next;
     myvarsl := {"a string","another","the last"};
     myvars := self.name+" XX "+itoa(self.hp);
     myvarint := activator.hp;
     myvaredp := "Rabbit Stew Complete" in activator.quests;
     pause;
     goto start:
   }
   dilend
---~---~---~---~---~---~---~---~---