“LlList2ListStrided”的版本间的差异
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: list llList2ListStrided( list src, integer start, integer…”) |
|||
第4行: | 第4行: | ||
{{函数详情 | {{函数详情 | ||
|函数名 = Function: list llList2ListStrided( list src, integer start, integer end, integer stride ); | |函数名 = Function: list llList2ListStrided( list src, integer start, integer end, integer stride ); | ||
− | |参数= | + | |参数= 参数: |
+ | list src | ||
integer start – start index | integer start – start index | ||
integer end – end index | integer end – end index |
2020年8月22日 (六) 02:05的最新版本
首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
函数名 |
---|
Function: list llList2ListStrided( list src, integer start, integer end, integer stride ); |
参数:
list src integer start – start index integer end – end index integer stride – number of entries per stride, if less than 1 it is assumed to be 1 |
返回值:
返回一个条纹列表中所有索引是从开始到结束范围中跨步的倍数的条目的列表。 |
注意事项 |
---|
*如果开始或结束都超出了界限,脚本将继续执行,而不会出现错误消息。
|
示例 |
---|
示例一
list mylist = [0,1,2,3,4,5,6]; list result_a = llList2ListStrided(mylist,0,-1,2); //start at first item in list, go to the end, return every 2nd item //result_a == [0,2,4,6] list result_b = llList2ListStrided(mylist,1,-1,2); //start at second item in list, go to the end, return every 2nd item //result_b == [2,4,6] list result_c = llList2ListStrided(mylist,2,-1,2); //start at third item in list, go to the end, return every 2nd item //result_c == [2,4,6] 示例二 list menu = ["1", "one", "2", "two", "3", "three"]; default { state_entry() { llListen(10, "", llGetOwner(), ""); } touch_start(integer detected) { list buttons = llList2ListStrided(menu, 0, -1, 2); llDialog(llDetectedKey(0), "choose a number", buttons, 10); } listen(integer channel, string obj, key id, string message) { integer index = llListFindList(menu, [message]); if (index != -1) { llOwnerSay("you chose " + llList2String(menu, index + 1) + " (" + message + ")"); } } } |
相关函数 |
---|
相关事件 |
---|