Goto » 历史记录 » 版本 1
machenhe, 2022-04-21 17:12
| 1 | 1 | machenhe | _*%{color:green}goto%*_ |
|---|---|---|---|
| 2 | 同一脚本文件内@块跳转 |
||
| 3 | |||
| 4 | 标签:命令定义|goto |
||
| 5 | |||
| 6 | *格式* |
||
| 7 | |命令名 |参数1 | |
||
| 8 | |goto |跳转标签 | |
||
| 9 | |||
| 10 | *说明* |
||
| 11 | * 参数1 |
||
| 12 | 跳转标签 |
||
| 13 | 以@开头的任意字符串 |
||
| 14 | %{color:deepPink}支持<$str()>变量取值% |
||
| 15 | |||
| 16 | |||
| 17 | - |
||
| 18 | - |
||
| 19 | |||
| 20 | *%{color:deepskyblue}脚本示例:%* |
||
| 21 | |||
| 22 | bq. [@main] |
||
| 23 | #if |
||
| 24 | #act |
||
| 25 | sendMsg 6 我是@main |
||
| 26 | goto @1 |
||
| 27 | %{color:lightgrey};--跳至@1% |
||
| 28 | [@1] |
||
| 29 | #if |
||
| 30 | #act |
||
| 31 | sendMsg 6 我是@1 |
||
| 32 | goto @2 |
||
| 33 | %{color:lightgrey};--跳至@2% |
||
| 34 | [@2] |
||
| 35 | #if |
||
| 36 | #act |
||
| 37 | sendMsg 6 我是@2 |
||
| 38 | |||
| 39 | - |
||
| 40 | - |
||
| 41 | |||
| 42 | bq. %{color:lightgrey};--goto 跳转标签支持变量% |
||
| 43 | [<notextile>@</notextile>main] |
||
| 44 | %{color:lightgrey}; |
||
| 45 | ;--设置跳转标签1的条件% |
||
| 46 | #if |
||
| 47 | #act |
||
| 48 | mov n1 1 |
||
| 49 | goto <notextile>@</notextile><$str(n1)> |
||
| 50 | %{color:lightgrey}; |
||
| 51 | ;--设置跳转标签2的条件% |
||
| 52 | #if |
||
| 53 | #act |
||
| 54 | mov n1 2 |
||
| 55 | goto <notextile>@</notextile><$str(n1)> |
||
| 56 | %{color:lightgrey}; |
||
| 57 | ;--设置跳转标签3的条件% |
||
| 58 | #if |
||
| 59 | #act |
||
| 60 | mov n1 3 |
||
| 61 | goto <notextile>@</notextile><$str(n1)> |
||
| 62 | %{color:lightgrey}; |
||
| 63 | ;标签1执行% |
||
| 64 | [@1] |
||
| 65 | #act |
||
| 66 | sendMsg 6 特戒初次问候 |
||
| 67 | %{color:lightgrey}; |
||
| 68 | ;标签2执行% |
||
| 69 | [@2] |
||
| 70 | #act |
||
| 71 | sendMsg 6 特戒再次问候 |
||
| 72 | %{color:lightgrey}; |
||
| 73 | ;标签3执行% |
||
| 74 | [@3] |
||
| 75 | #act |
||
| 76 | sendMsg 6 特戒三次问候 |