SortList » 历史记录 » 版本 1
tejie, 2024-07-02 15:36
| 1 | 1 | tejie | h4. _%{color:green}sortList%_ |
|---|---|---|---|
| 2 | |||
| 3 | 数组元素排序 |
||
| 4 | |||
| 5 | 标签:命令定义|sortList>sortList |
||
| 6 | |||
| 7 | *格式* |
||
| 8 | |命令名 |参数1 |参数2 |参数3 |参数4 | |
||
| 9 | |sortList |原始数组 |返回数组 |排序方向 |排序类型 | |
||
| 10 | |||
| 11 | |||
| 12 | *说明* |
||
| 13 | * 参数1:原始数组 |
||
| 14 | |||
| 15 | * 参数2:排序后返回的数组 |
||
| 16 | |||
| 17 | * 参数3:排序方向 |
||
| 18 | |缺省或0|升序方向| |
||
| 19 | |1|降序方向| |
||
| 20 | |||
| 21 | * 参数4:排序类型 |
||
| 22 | |缺省或0|数值排序| |
||
| 23 | |1|文本排序| |
||
| 24 | |||
| 25 | - |
||
| 26 | - |
||
| 27 | |||
| 28 | h4. *%{color:deepskyblue}特戒引擎脚本示例:%* |
||
| 29 | |||
| 30 | bq. [@main] |
||
| 31 | #if |
||
| 32 | #act |
||
| 33 | [[mov]] L$测试 [11,22,33,44,55,66,77,88] |
||
| 34 | %{color:lightGrey};--参数3 0或缺省升序,1降序;参数4 0或缺省数值排序,1文本排序% |
||
| 35 | *{color:green}sortList* L$测试 L$测试2 1 0 |
||
| 36 | [[print]] 【元素排序10】<$str(L$测试2)> |
||
| 37 | <notextile></notextile> |
||
| 38 | *{color:green}sortList* L$测试 L$测试2 0 0 |
||
| 39 | [[print]] 【元素排序00】<$str(L$测试2)> |
||
| 40 | <notextile></notextile> |
||
| 41 | [[mov]] L$测试 [aa,cc,dd,bb,ee,ff] |
||
| 42 | *{color:green}sortList* L$测试 L$测试2 0 1 |
||
| 43 | [[print]] 【元素排序01】<$str(L$测试2)> |
||
| 44 | <notextile></notextile> |
||
| 45 | *{color:green}sortList* L$测试 L$测试2 1 1 |
||
| 46 | [[print]] 【元素排序11】<$str(L$测试2)> |
||
| 47 | <notextile></notextile> |
||
| 48 | [[mov]] L$测试 [11,22,33,44,55,66,77,aa] |
||
| 49 | *{color:green}sortList* L$测试 L$测试2 1 0 |
||
| 50 | %{color:lightGrey};--数字排序,如有字符元素,输出[error]% |
||
| 51 | print 【元素排序err】<$str(L$测试2)> |