en:documentation:expressions
Различия
Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слеваПредыдущая версияСледующая версия | Предыдущая версияПоследняя версияСледующая версия справа и слева | ||
en:documentation:expressions [2020/04/06 14:21] – loopback | en:documentation:expressions [2020/04/07 19:56] – loopback | ||
---|---|---|---|
Строка 1: | Строка 1: | ||
====== Expressions ====== | ====== Expressions ====== | ||
- | Here is one and only conditional statement: | + | Expressions are used in [[conditions|conditions]]. Starting with version 2.0.10, calculated expressions can also be used in all parameters of Autorun commands. |
+ | |||
+ | For use in command parameters, the parameter must be in quotation marks and immediately before them | ||
+ | there was a " | ||
< | < | ||
- | If [Not] < | + | Set Delay 500 |
- | ... | + | Sleep %"1000 + %Delay%" |
- | ElseIf [Not] < | + | # result = 1500. |
- | | + | |
- | Else | + | |
- | ... | + | |
- | EndIf | + | |
</ | </ | ||
+ | |||
+ | Inside quotes for text constants, as elsewhere, you can use quotes of a different type: | ||
+ | < | ||
+ | StrLen var %'" | ||
+ | # var => String_1 | ||
+ | </ | ||
+ | |||
+ | Although text constants that not wrapped in quotation marks can be used in expressions, | ||
+ | |||
+ | Arithmetic operations, the concatenation operation "&" | ||
For numeric comparison operator can be one of: =, <>, >, <, >=, <=. For string comparison only = and <> allowed, comparison is case insensitive. Allowed brackets and operators AND and OR. If both expressions are numeric, then numeric comparison used. | For numeric comparison operator can be one of: =, <>, >, <, >=, <=. For string comparison only = and <> allowed, comparison is case insensitive. Allowed brackets and operators AND and OR. If both expressions are numeric, then numeric comparison used. | ||
- | Variables are always expanding in the expressions. | + | If both expressions |
+ | |||
+ | Brackets and AND, OR, and NOT operators are also allowed. True/False keywords are allowed, which are equivalent to the strings " | ||
+ | |||
+ | The priority of operations, from highest to lowest: | ||
< | < | ||
- | If (" | + | NOT |
+ | * / | ||
+ | + - | ||
+ | & | ||
+ | < > <= >= = <> | ||
+ | AND OR | ||
</ | </ | ||
- | Also, some special functions can be used in comparison. In this case comparison limited to only one function. | + | **Using commands |
+ | It is possible to use any Autorun commands in expressions, | ||
+ | |||
+ | To use a command as a function in an expression, it must be written using brackets and a comma as a parameter separator. The first parameter (variable name for the return value) is not used in this case. If you need to use the switches, you need to pass them in the first parameter, in quotation marks separated by a space, the parameter text should begin with the character " | ||
< | < | ||
- | If [Not] Function1 < | + | CommandName(["~/S1 /S2 .. /SN",] Param1, Param2, |
- | | + | |
- | ElseIf [Not] Function2 < | + | |
- | ... | + | |
- | Else | + | |
- | ... | + | |
- | EndIf | + | |
</ | </ | ||
- | It's allowed to use both expressions and function | + | Example: |
+ | < | ||
+ | Set zz " | ||
+ | MsgBox %" | ||
+ | # => 7 | ||
+ | </ | ||
+ | |||
+ | You can use nested commands | ||
+ | < | ||
+ | Set zz " | ||
+ | MsgBox %" | ||
+ | # => abc-6-5 | ||
+ | </ | ||
en/documentation/expressions.txt · Последнее изменение: 2020/04/24 16:29 — loopback