LlDeleteSubList

来自人工智能助力教育知识百科
跳转至: 导航搜索

Template:Needs Translation/


函数名
Function: list llDeleteSubList( list src, integer start, integer end );
参数:
  • 列出src -源代码
  • 整数启动-启动索引
  • 整数端-端索引
返回值:返回一个列表,该列表是src的副本,但是从开始到结束的切片已被删除。
注意事项
注意事项
  • 如果开始或结束超出了界限,脚本将继续执行,不会出现错误消息。
  • 开始和结束将形成一个排除范围,当开始是过去的结束(大约:开始>结束)。
示例
src = llDeleteSubList( src, start, end )
default
{
    state_entry()
    {
        // Create a list of names
        list names = ["Anthony", "Bob", "Charlie", "Diane", "Edgar", "Gabriela"];
 
        // Now let's remove values at position 1 through 2.
        names = llDeleteSubList(names, 1, 2);
 
        // Result:
        // list names = ["Anthony", "Diane", "Edgar", "Gabriela"];
 
        // Now let's use an start number higher then our end number
        names = llDeleteSubList(names, 3, 1);
 
        // Result:
        // list names = ["Edgar"];
        // If start number higher then our end number, then we should imagine that the start and the end are missing before start and end.
        // Imagine it should be FROM_THE_LISTSTART_CUT: start, AND_FROM_THE_LISTEND_CUT: end ... more or less :))
        // names = llDeleteSubList(names, 3 -> , <- 1);
 
    }
}
相关函数
llListInsertList

llListReplaceList llList2List

相关事件