Manual:DIL Manual/insert()

From DikuMUD Wiki
Jump to navigation Jump to search

Function:  insert( sl : <stringlist or intlist>, i : integer, s : string ) ;
  sl
         the stringlist or intlist you are inserting to
  i
         the index where you want to insert the string
  s
         the string you want to insert
This function allows you to insert a string in a stringlist or intlist
with out re-writing the entire stringlist or intlist to do it.  The
following Dil will add a string in order to a stringlist.
Example:

---~---~---~---~---~---~---~---~---
dilbegin stringlist add_in_order (sl:stringlist,s:string);
var
 i:integer;
 ln:integer;
code

dilend

---~---~---~---~---~---~---~---~---


---~---~---~---~---~---~---~---~---

Function:  insert( sl : <stringlist or intlist>, i : integer, s : string ) ;
  sl
         the stringlist or intlist you are inserting to
  i
         the index where you want to insert the string
  s
         the string you want to insert
This function allows you to insert a string in a stringlist or intlist
with out re-writing the entire stringlist or intlist to do it.  The
following Dil will add a string in order to a stringlist.
Example:

---~---~---~---~---~---~---~---~---
dilbegin stringlist add_in_order (sl:stringlist,s:string);
var
 i:integer;
 ln:integer;
code

dilend

---~---~---~---~---~---~---~---~---


---~---~---~---~---~---~---~---~---