Dec » 历史记录 » 版本 1
machenhe, 2022-04-21 15:23
1 | 1 | machenhe | _*%{color:green}dec%*_ |
---|---|---|---|
2 | 数字或字符串变量累减 |
||
3 | |||
4 | *格式* |
||
5 | |命令名 |参数1 |参数2 | |
||
6 | |dec |变量 |变量(或数值) | |
||
7 | |||
8 | *说明* |
||
9 | * 参数1 |
||
10 | 待被累减的变量 |
||
11 | 累减结果会存入该变量 |
||
12 | |||
13 | * 参数2 |
||
14 | 用来累减的变量(或数值) |
||
15 | |||
16 | * 关于参数1和参数2的数据类型,及处理结果 |
||
17 | |=. *参数1类型* |=. *参数2类型* |=. *处理结果* | |
||
18 | |参数1为整数 |参数2为整数 |参数1数值减去参数2数值,返回给参数1 | |
||
19 | |参数1为字符串 |参数2为整数 |参数1从首字母起保留参数2个字符,返回给参数1 | |
||
20 | |参数1为字符串 |参数2为字符串 |参数2匹配参数1中相应字符串替换为空,返回给参数1 | |
||
21 | |参数1为整数 |参数2为字符串 |参数1保持不变 | |
||
22 | |||
23 | - |
||
24 | - |
||
25 | |||
26 | *%{color:deepskyblue}脚本示例:%* |
||
27 | |||
28 | bq. [@main] |
||
29 | #if |
||
30 | #act |
||
31 | mov n10 2 |
||
32 | mov n14 1 |
||
33 | dec n10 <$str(n14)> |
||
34 | sendMsg 6 1号测试<$str(n10)> |
||
35 | %{color:lightgrey};------------------------------------------% |
||
36 | mov n10 2 |
||
37 | mov n14 1 |
||
38 | dec n10 n14 |
||
39 | sendMsg 6 2号测试<$str(n10)> |
||
40 | %{color:lightgrey};------------------------------------------% |
||
41 | mov s10 abcde |
||
42 | dec s10 2 |
||
43 | sendMsg 6 3号测试<$str(s10)> |
||
44 | %{color:lightgrey};------------------------------------------% |
||
45 | mov s10 abcb |
||
46 | mov s14 b |
||
47 | dec s10 <$str(s14)> |
||
48 | sendMsg 6 4号测试<$str(s10)> |
||
49 | %{color:lightgrey};------------------------------------------% |
||
50 | mov n10 2 |
||
51 | mov s14 abc |
||
52 | dec n10 s14 |
||
53 | sendMsg 6 5号测试<$str(n10)> |