en:documentation:expressions
Различия
Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слеваПредыдущая версияСледующая версия | Предыдущая версияСледующая версияСледующая версия справа и слева | ||
en:documentation:expressions [2020/04/06 14:21] – loopback | en:documentation:expressions [2020/04/07 19:53] – 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. | ||
+ | |||
+ | If both expressions are numeric, a numeric comparison is used. The following operators can be used: =, <>, >, <, >=, <=. For string comparisons, | ||
+ | |||
+ | 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: | ||
+ | |||
+ | < | ||
+ | NOT | ||
+ | * / | ||
+ | + - | ||
+ | & | ||
+ | < > <= >= = <> | ||
+ | AND OR | ||
+ | </ | ||
+ | |||
+ | **Использование команд в выражениях** | ||
+ | |||
+ | В выражениях возможно использование любых команд Autorun, но смысл имеет использование тех, которые возвращают результат. | ||
+ | |||
+ | Для использования команды в качестве функции в выражении, | ||
+ | < | ||
+ | CommandName([" | ||
+ | </ | ||
+ | |||
+ | Пример: | ||
+ | < | ||
+ | Set zz " | ||
+ | MsgBox %" | ||
+ | # => 7 | ||
+ | </ | ||
+ | |||
+ | В выражениях можно использовать вложенные команды: | ||
+ | < | ||
+ | Set zz " | ||
+ | MsgBox %" | ||
+ | # => abc-6-5 | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Variables are always expanding in the expressions. If you assume that variable value can conatin spaces, wrap expression in quotes. Example: | Variables are always expanding in the expressions. If you assume that variable value can conatin spaces, wrap expression in quotes. Example: |
en/documentation/expressions.txt · Последнее изменение: 2020/04/24 16:29 — loopback