The wasCircularListInsertBefore function takes as input a circular list, an element in the list an element to insert and inserts the element before the element in the list and returns the resulting list. An example call is the following:

list a = [ 1, 2, 3, 4, 5 ];
a = wasCircularListInsertBefore(a, [4], ["b"]);

after which the contents of the list a will be:

1 2 3 b 4 5


//  Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3      //
list wasCircularListInsertBefore(list input, list node, list insert) {
    integer i = llListFindList(input, node);
    if(i == -1) return input;
    return llListInsertList(input, insert, i);

secondlife/circular_double_linked_lists/list/insert_before.txt ยท Last modified: 2017/02/22 18:20 (external edit)

Access website using Tor

For the copyright, license, warranty and privacy terms for the usage of this website please see the license and privacy pages.