Инструменты пользователя

Инструменты сайта


en:documentation:variables

Это старая версия документа!


Variables

Plugin operates with two types of variables — internal and environmental variables. The only difference between them is only that the internal variables are only visible in the plugin, and the environment variables are available for Total Commander and programs, that run from it.

In general, a variable name can only contain Latin letters, numbers, and the underscore «_». Internal variables are set with Set command, and environment variables with SetEnv. When you use variables in the command, Autorun does not differentiate between them and can get their values from both, but writing from the commands is available only into internal variables (the obvious exception — SetEnv). However, this behavior can be changed by AutorunAllowWriteEnv directive.

When you use variables in the command follow a simple rule: if the value is reading («expanding»), the variable must be wrapped around with percent «%». If the variable is writing (commands Set, SetEnv, and others), its name is written as is. Example:

Set MY_COMMANDER_PATH %COMMANDER_PATH%

In the above example, the environment variable COMMANDER_PATH will be read and then written to the variable MY_COMMANDER_PATH.

Predefined constants

Plugin have few predefined variables (constants):

%AUTORUN_OSARCH%The OS architecture where TC is running. This can be either 32 or 64. Equal to %SYSINFO_OSARCH%.
%AUTORUN_TCHANDLE%Total Commander window handle (for using in scripts).
%AUTORUN_TCPID%Total Commander process ID (for using in scripts).
%AUTORUN_ISADMIN%1 if TC executed under admin, else 0.
%AUTORUN_TCARCH%32 or 64 — TotalCommander architecture, where plugin loaded.
%AUTORUN_TCCMDLINE%Commandline of TotalCommander.

You can not redefine these constants.

Additional constants with system information are available in the plugin SysInfo.

ERROR variable

Autorun has a special ERROR variable. It is usually zero, but some commands may set it to a different value in the case of non-fatal errors (see the documentation for the command). If you need this information, check the value of the variable immediately after the operation, as the following command can change the value of the variable.

en/documentation/variables.1588179591.txt.gz · Последнее изменение: 2020/04/29 19:59 — loopback

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki