Difference between revisions of "Manual:DIL Manual/Expressions"

From DikuMUD Wiki
Jump to navigation Jump to search
m
(XML import)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
<span id="express"></span>
 +
 +
<h3>'''Expressions:'''</h3>
 +
  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:'''
 +
 +
<nowiki>
 +
 +
  dilbegin foo();
 +
  var
 +
    myvarsl : stringlist;
 +
    myvars : string;
 +
    myvarint : integer;
 +
    myvaredp : extraptr;
 +
    myvarunit : unitptr;
 +
  code
 +
dilend</nowiki>
  
 +
---~---~---~---~---~---~---~---~---
 
<span id="express"></span>
 
<span id="express"></span>
  
  <h3>Expressions:</h3>
+
  <h3>'''Expressions:'''</h3>
 
   The expressions used in assignment can return any
 
   The expressions used in assignment can return any
 
   of the types you can declare variables. Also they might return
 
   of the types you can declare variables. Also they might return
Line 22: Line 44:
 
     myvarunit : unitptr;
 
     myvarunit : unitptr;
 
   code
 
   code
  {
+
dilend</nowiki>
    :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</nowiki>
 
  
 
  ---~---~---~---~---~---~---~---~---
 
  ---~---~---~---~---~---~---~---~---

Latest revision as of 22:31, 4 December 2025

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
dilend
---~---~---~---~---~---~---~---~---

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
dilend
---~---~---~---~---~---~---~---~---