en:documentation:expressions
Различия
Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слеваПредыдущая версияСледующая версия | Предыдущая версияПоследняя версияСледующая версия справа и слева | ||
en:documentation:expressions [2020/04/07 19:49] – loopback | en:documentation:expressions [2020/04/07 19:56] – loopback | ||
---|---|---|---|
Строка 1: | Строка 1: | ||
====== Expressions ====== | ====== Expressions ====== | ||
- | Выражения используются в [[conditions|условиях]]. Начиная с версии | + | Expressions are used in [[conditions|conditions]]. Starting with version |
- | Для использования в параметрах команд необходимо чтобы параметр был в кавычках и непосредственно перед ними | + | For use in command parameters, the parameter must be in quotation marks and immediately before them |
- | стоял знак | + | there was a " |
< | < | ||
Set Delay 500 | Set Delay 500 | ||
Sleep %"1000 + %Delay%" | Sleep %"1000 + %Delay%" | ||
- | # результат вычисления - 1500. | + | # result = 1500. |
</ | </ | ||
- | Внутри кавычек для текстовых констант, как и везде, можно использовать кавычки другого типа: | + | Inside quotes for text constants, as elsewhere, you can use quotes of a different type: |
< | < | ||
- | Set sl 1000 | + | StrLen var %'" |
- | StrLen var %'" | + | # var => String_1 |
- | # var => Строка_1 | + | |
</ | </ | ||
- | Хотя в выражениях могут использоваться текстовые константы, не обернутые в кавычки, | + | Although text constants that not wrapped in quotation marks can be used in expressions, this option is left for compatibility purposes only. It is highly recommended that you use quotation marks everywhere. This will significantly reduce the number of possible errors. |
Arithmetic operations, the concatenation operation "&" | Arithmetic operations, the concatenation operation "&" | ||
Строка 29: | Строка 28: | ||
Brackets and AND, OR, and NOT operators are also allowed. True/False keywords are allowed, which are equivalent to the strings " | 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: |
< | < | ||
Строка 40: | Строка 39: | ||
</ | </ | ||
- | **Использование команд в выражениях** | + | **Using commands in expressions** |
- | В выражениях возможно использование любых команд | + | It is possible to use any Autorun |
+ | |||
+ | 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 " | ||
- | Для использования команды в качестве функции в выражении, | ||
< | < | ||
CommandName([" | CommandName([" | ||
</ | </ | ||
- | Пример: | + | Example: |
< | < | ||
Set zz " | Set zz " | ||
Строка 56: | Строка 56: | ||
</ | </ | ||
- | В выражениях можно использовать вложенные команды: | + | You can use nested commands in expressions: |
< | < | ||
Set zz " | Set zz " | ||
Строка 62: | Строка 62: | ||
# => abc-6-5 | # => abc-6-5 | ||
</ | </ | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | Variables are always expanding in the expressions. If you assume that variable value can conatin spaces, wrap expression in quotes. Example: | ||
- | |||
- | < | ||
- | If (" | ||
- | </ | ||
- | |||
- | Also, some special functions can be used in comparison. In this case comparison limited to only one function. | ||
- | |||
- | |||
- | < | ||
- | If [Not] Function1 < | ||
- | ... | ||
- | ElseIf [Not] Function2 < | ||
- | ... | ||
- | Else | ||
- | ... | ||
- | EndIf | ||
- | </ | ||
- | |||
- | It's allowed to use both expressions and function in one condition (but in different branches). | ||
en/documentation/expressions.txt · Последнее изменение: 2020/04/24 16:29 — loopback