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

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
(checked against the compiler and the interpreter; example compiles)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
−
<span id="intlist"></span>
+
= integerlist =
−
'''Intlist:'''
+
'''Type.''' Another name used on this wiki for [[Manual:DIL Manual/intlist|intlist]].
  
−
  Intlists are an array of integer types. They can be set directly as follows:
+
DIL has no keyword <code>integerlist</code>: a list of integers is declared with <code>intlist</code>.
  
−
  '''Example'''
+
  var
 +
    il : intlist;
  
−
wpn:=
+
See [[Manual:DIL Manual/intlist|intlist]].
−
;
 
  
−
The intlists can be accessed in the same way stringlist are accessed as follows.
+
== See also ==
−
 
+
* [[Manual:DIL Manual/intlist|intlist]]
−
'''Example'''
+
* [[Manual:DIL Manual/stringlist|stringlist]]
−
 
 
−
if (wpn.[5]==5)
 
−
The intlists are saved on savable units.
 
−
 
 
−
'''Type:  '''<i><!--CODE-->intlist</i><!--ENDCODE-->
 
−
 
 
−
  This variable type allows you to keep an ordered list of integers with out
 
−
having to create a variable for each integer.
 
−
'''Example:'''  <i><!--CODE-->Setting an intlist</i><!--ENDCODE-->
 
−
<i><!--CODE-->
 
−
---~---~---~---~---~---~---~---~---
 
−
 
 
−
myintlist:=
 
−
;
 
−
myintlist.[10]:=50;
 
−
 
 
−
---~---~---~---~---~---~---~---~---
 
−
 
 
−
</i><!--ENDCODE-->
 
−
 
 
−
  If you set a index that is higher then the highest index, every index in
 
−
between will be set to zero.  For example if you only have two values in the
 
−
intlist and you set index value 10 to 50 all indexes between 2 and 10 will be
 
−
set to 0.
 
−
'''Example:'''  <i><!--CODE-->Using intlists</i><!--ENDCODE-->
 
−
<i><!--CODE-->
 
−
---~---~---~---~---~---~---~---~---
 
−
 
 
−
if (myintlist.[5]==5)
 
−
if (myintlist&lt;myint)
 
−
i:=0;
 
−
ln:=length(myintlist);
 
−
while (i&lt;ln)
 
−
---~---~---~---~---~---~---~---~---
 
−
 
 
−
</i><!--ENDCODE-->
 
−
'''See Also:'''
 
−
[[#bpinsert|Insert]]
 
−
[[#bpremove|Remove]]
 
−
[[#eptr|Extraptr]]
 
−
<span id="intlist"></span>
 
−
'''Intlist:'''
 
−
 
 
−
  Intlists are an array of integer types.  They can be set directly as follows:
 
−
 
 
−
'''Example'''
 
−
 
 
−
wpn:=
 
−
;
 
−
 
 
−
The intlists can be accessed in the same way stringlist are accessed as follows.
 
−
 
 
−
'''Example'''
 
−
 
 
−
if (wpn.[5]==5)
 
−
The intlists are saved on savable units.
 
−
 
 
−
'''Type:  '''<i><!--CODE-->intlist</i><!--ENDCODE-->
 
−
 
 
−
  This variable type allows you to keep an ordered list of integers with out
 
−
having to create a variable for each integer.
 
−
'''Example:'''  <i><!--CODE-->Setting an intlist</i><!--ENDCODE-->
 
−
<i><!--CODE-->
 
−
---~---~---~---~---~---~---~---~---
 
−
 
 
−
myintlist:=
 
−
;
 
−
myintlist.[10]:=50;
 
−
 
 
−
---~---~---~---~---~---~---~---~---
 
−
 
 
−
</i><!--ENDCODE-->
 
−
 
 
−
  If you set a index that is higher then the highest index, every index in
 
−
between will be set to zero.  For example if you only have two values in the
 
−
intlist and you set index value 10 to 50 all indexes between 2 and 10 will be
 
−
set to 0.
 
−
'''Example:'''  <i><!--CODE-->Using intlists</i><!--ENDCODE-->
 
−
<i><!--CODE-->
 
−
---~---~---~---~---~---~---~---~---
 
−
 
 
−
if (myintlist.[5]==5)
 
−
if (myintlist&lt;myint)
 
−
i:=0;
 
−
ln:=length(myintlist);
 
−
while (i&lt;ln)
 
−
---~---~---~---~---~---~---~---~---
 
−
 
 
−
</i><!--ENDCODE-->
 
−
'''See Also:'''
 
−
[[#bpinsert|Insert]]
 
−
[[#bpremove|Remove]]
 
−
[[#eptr|Extraptr]]
 

Latest revision as of 23:28, 14 November 2026

integerlist

Type. Another name used on this wiki for intlist.

DIL has no keyword integerlist: a list of integers is declared with intlist.

var
   il : intlist;

See intlist.

See also