OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.llListInsertList C# (CSharp) Method

llListInsertList() public method

Insert the list identified by src into the list designated by dest such that the first new element has the index specified by index
public llListInsertList ( OpenSim.Region.ScriptEngine.Shared.LSL_Types.list dest, OpenSim.Region.ScriptEngine.Shared.LSL_Types.list src, int index ) : OpenSim.Region.ScriptEngine.Shared.LSL_Types.list
dest OpenSim.Region.ScriptEngine.Shared.LSL_Types.list
src OpenSim.Region.ScriptEngine.Shared.LSL_Types.list
index int
return OpenSim.Region.ScriptEngine.Shared.LSL_Types.list
        public LSL_List llListInsertList(LSL_List dest, LSL_List src, int index)
        {

            LSL_List pref;
            LSL_List suff;

            m_host.AddScriptLPS(1);

            if (index < 0)
            {
                index = index+dest.Length;
                if (index < 0)
                {
                    index = 0;
                }
            }

            if (index != 0)
            {
                pref = dest.GetSublist(0,index-1);
                if (index < dest.Length)
                {
                    suff = dest.GetSublist(index,-1);
                    return pref + src + suff;
                }
                else
                {
                    return pref + src;
                }
            }
            else
            {
                if (index < dest.Length)
                {
                    suff = dest.GetSublist(index,-1);
                    return src + suff;
                }
                else
                {
                    return src;
                }
            }

        }
LSL_Api