Variables

You can use the variables to store some values associated with the names and use them later in the macro sequences. Both global and local variables can be used in the macro sequence.

Naming

Local variable name begins with the '%' sign followed by the alpha characters, numbers or '_' characters.

Global variable name begins with the '%%' signs followed by the alpha characters, numbers or '_' characters.

Variable value assignment should be ended with ';'

Variable names are not case sensitive thus '%myStr' and '%MYstr' is the same variable.

Types

Variables can be either string or integer.

Integer constants can be represented by: NNN - decimal constant, 0NNN - octal constant, 0xNNN - hexadecimal constant.

Integers are of 64 bit width.

Scope of action

The scope for the local variables is the current macro sequence.

The scope for the global variables is a current FAR Manager session. Global variables can be stored in the Vars execution area. Every time FAR starts up it restores the global variables stored in this area.

Representation in registry

В реестре глобальные переменные располагаются в специальной ветке [HKEY_CURRENT_USER\Software\Far\[Users\USERNAME\]KeyMacros\Vars].

Каждая глобальная переменная имеет имя и может быть трех типов REG_SZ (для строковых констант) и REG_DWORD или REG_QDWORD (для целочисленных констант). Если изначально константа имела тип REG_DWORD, то при сохранении с помощью функции msave тип меняется на REG_QDWORD.

Notes

  1. It is impossible to use macro-language elements while recording a macro in a usual way. Macro-language elements can be added to the sequence only by editing the registry manually or by using special applications or FAR plugins.
See also:
msave()