Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.llListFindList C# (CSharp) Method

llListFindList() public method

Returns the index of the first occurrence of test in src.
public llListFindList ( Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list src, Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list test ) : Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLInteger
src Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list
test Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list
return Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLInteger
        public LSL_Integer llListFindList(LSL_List src, LSL_List test)
        {

            int index = -1;
            int length = src.Length - test.Length + 1;

            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return 0;


            // If either list is empty, do not match

            if (src.Length != 0 && test.Length != 0)
            {
                for (int i = 0; i < length; i++)
                {
                    if (src.Data[i].Equals(test.Data[0]))
                    {
                        int j;
                        for (j = 1; j < test.Length; j++)
                            if (!src.Data[i + j].Equals(test.Data[j]))
                                break;
                        if (j == test.Length)
                        {
                            index = i;
                            break;
                        }
                    }
                }
            }

            return index;

        }
LSL_Api