Goto http://www.stucuk.netGoto http://www.atlanticaonlinewiki.comGoto http://www.game-requirements.com

Insert

From Original War Support Wiki

Jump to: navigation, search

SAIL Functions/I -> Insert


Contents

Description

Function Insert inserts the specified value (or list) the specified place in the specified list. Returns the modified list.

Template

Insert(list, index_number, new_value);

list - The list you want to add a value to
index_number - An integer defining where in the specified list you want to place the new value
new_value - The value you want to add

Example

Export the_list;

Every 0$1 do
  begin
    the_list = [5,8,23,11];
    Wait(0$3);
    the_list = Insert(the_list,3,77);
  end;

Now "the_list" holds the following list: [5,8,77,23,11]

An alternative

Alternatively you can use "^" to add a value to a list (you can't add lists to lists in this way, though). The value will be placed in continuation of the targeted list.

Export another_list;

Every 0$3 do
  begin
    another_list = [4,2,5];
    Wait(0$1);
    another_list = another_list^7;
  end;

Now "another_list" holds this list: [4,2,5,7]

See also

Personal tools
Clanbase
This is a cached copy of the requested page, and may not be up to date.

Sorry! This site is experiencing technical difficulties.
Try waiting a few minutes and reloading.

(Can't contact the database server: MySQL functions missing, have you compiled PHP with the --with-mysql option? )


You can try searching via Google in the meantime.
Note that their indexes of our content may be out of date.