多元数组元素变量 » 历史记录 » 版本 1
tejie, 2024-07-02 15:26
| 1 | 1 | tejie | - |
|---|---|---|---|
| 2 | - |
||
| 3 | |||
| 4 | h3. 多元数组元素变量 |
||
| 5 | |||
| 6 | h4. %{color:fireBrick}相关命令% |
||
| 7 | |||
| 8 | |取值在数组位置 |[[getListVarIndex]] | |
||
| 9 | |获取元素数量 |[[getListVarCount]] | |
||
| 10 | |值是否在数组中 |[[checkVarInList]] | |
||
| 11 | |数组是否全数字 |[[checkListAllDigit]] | |
||
| 12 | |获取数组最大值 |[[getListMaxVar]] | |
||
| 13 | |获取数组最小值 |[[getListMinVar]] | |
||
| 14 | |数组元素反转 |[[reverseList]] | |
||
| 15 | |数组元素排序 |[[sortList]] | |
||
| 16 | |||
| 17 | h4. *%{color:deepskyblue}特戒引擎脚本示例:%* |
||
| 18 | |||
| 19 | bq. %{color:green}<notextile>[@数组赋值]</notextile>% |
||
| 20 | #act |
||
| 21 | [[mov]] L$测试 [11,22,33,44,55,66,77,aa] |
||
| 22 | [[print]] 【数组赋值】<$str(L$测试)> |
||
| 23 | <notextile></notextile> |
||
| 24 | %{color:green}<notextile>[@元素取值]</notextile>% |
||
| 25 | #act |
||
| 26 | [[mov]] L$测试 [11,22,33,44,55,66,77,aa] |
||
| 27 | %{color:lightGrey};--从左向右取值% |
||
| 28 | [[print]] 【元素取值】<notextile><$str(L$测试[0])>,<$str(L$测试[1])>,<$str(L$测试[2])></notextile> |
||
| 29 | %{color:lightGrey};--从右向左取值% |
||
| 30 | [[print]] 【元素取值】<$str(L$测试[-1])>,<notextile><$str(L$测试[-2])>,<$str(L$测试[-3])></notextile> |
||
| 31 | <notextile></notextile> |
||
| 32 | %{color:green}<notextile>[@元素改值]</notextile>% |
||
| 33 | #act |
||
| 34 | [[mov]] L$测试 [11,22,33,44,55,66,77,aa] |
||
| 35 | [[mov]] <notextile>L$测试[0]</notextile> 00 |
||
| 36 | [[print]] 【元素改值】<$str(L$测试)> |
||
| 37 | <notextile></notextile> |
||
| 38 | [[mov]] L$测试2 [aa,bb,cc] |
||
| 39 | [[mov]] <notextile>L$测试[0]</notextile> <$str(L$测试2)> |
||
| 40 | [[print]] 【元素改值】<$str(L$测试)> |
||
| 41 | <notextile></notextile> |
||
| 42 | %{color:green}[@增加元素]% |
||
| 43 | #act |
||
| 44 | [[mov]] L$测试 [11,22,33,44,55,66,77,aa] |
||
| 45 | [[inc]] L$测试 bb |
||
| 46 | [[print]] 【增加元素】<$str(L$测试)> |
||
| 47 | <notextile></notextile> |
||
| 48 | %{color:green}<notextile>[@删除元素]</notextile>% |
||
| 49 | #act |
||
| 50 | [[mov]] L$测试 [11,22,33,44,55,66,77,aa] |
||
| 51 | [[dec]] L$测试 22 |
||
| 52 | [[print]] 【删除元素】<$str(L$测试)> |
||
| 53 | <notextile></notextile> |
||
| 54 | %{color:green}<notextile>[@元素下标变量]</notextile>% |
||
| 55 | #act |
||
| 56 | [[mov]] L$测试 [1,2,3] |
||
| 57 | [[mov]] N1 1 |
||
| 58 | [[mov]] L$测试[<$str(n1)>] 23 |
||
| 59 | [[print]] 【元素下标变量1】<$str(L$测试)> |
||
| 60 | [[print]] 【元素下标变量2】<$str(L$测试[<$str(n1)>])> |
||
| 61 | <notextile></notextile> |
||
| 62 | %{color:green}<notextile>[@元素清空]</notextile>% |
||
| 63 | #if |
||
| 64 | #act |
||
| 65 | [[mov]] L$测试 [11,22,33,44,55,66,77,aa] |
||
| 66 | [[mov]] L$测试 [] |
||
| 67 | [[print]] 【元素清空】<$str(L$测试)> |
||
| 68 | <notextile></notextile> |
||
| 69 | [[mov]] L$测试 [11,22,33,44,55,66,77,aa] |
||
| 70 | [[mov]] L$测试 |
||
| 71 | [[print]] 【元素清空】<$str(L$测试)> |
||
| 72 | <notextile></notextile> |
||
| 73 | %{color:green}<notextile>[@变量传值]</notextile>% |
||
| 74 | #if |
||
| 75 | #act |
||
| 76 | [[mov]] L$测试 [1,2,3] |
||
| 77 | [[goto]] <notextile>@</notextile>变量传值(<$str(L$测试)>) |
||
| 78 | <notextile>[@变量传值]</notextile> |
||
| 79 | #if |
||
| 80 | #act |
||
| 81 | [[print]] 【变量传值】<$scriptParam1> |