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

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


en:autorun:documentation:directives

Directives

Directives are performed during the pre-processing script, before actual executing begins. Directive begins with the «Pragma» keyword.

Pragma AutorunFinalizeSection

The script after this directive is processed at the Total Commander closing stage. If the directive is not used, no actions performed at the Total Commander closing stage. The use of this directive is allowed only in the main script file; it will be ignored in include files.

Pragma AutorunBlockUnload

Blocks unloading plugin (using cm_UnloadPlugins) until closing Total Commander. Useful for ShellExec with /T switch. If the directive is not used, the blocking disabled.

Pragma AutorunLanguage <ID>

Loads the custom language messages from file autorun.lng. If this directive is not used, the language set in Total Commander will be used. If there is no translation for that language in the file, the default language (English) will be used.

If this directive is not used, the default language (English) used. Since all plugin messages — errors, it makes sense to use this directive only during debugging.

In order to be able to localize error messages that occur during the pre-processing stage, this directive must be located at the very beginning of the script.

IDTwo or three-character language identifier, that used in Total Commander language files. File autorun.lng should contain a section with the same name. If a section is not found, English will be used.


Pragma AutorunLoadInSubprocess

By default, Autorun full not run, if TC executed as separate process for search/view/etc. But you can change this behaviour with this directive.

Pragma Include <filename>

Loads an additional script file in Autorun format. It can be a library of useful user-defined functions, or the main Autorun script moved to another location. The path can be relative to the Autorun directory, it can also use environment variables that exist at the time Total Commander was launched. Internal variables do not yet exist at the time of directive processing, so they cannot be used!

The contents of the file is inserted at the location where the directive was encountered by preprocessor. If the included file contains global variables, it makes more sense to place it at the beginning of the main script.

Also note that loading occurs at the preprocessing stage, which means that the conditions do not work here yet.

Pragma IncludeOnce

The directive can be placed at the beginning of the included file (it doesn't make sense in the main script). Tells the preprocessor that the contents of the file should only be inserted once, which helps avoid duplicate function definitions. If the directive is not used, the contents of the file will be inserted as many times as the Include directive with the name of this file is encountered.

Pragma LegacyExpressions

When using this directive, text constants that are not wrapped in quotes can be used in expressions. This is only valid for expressions (including «calculating strings»), not for commands in command notation.

:!: The directive was added only to simplify the transition from versions 2.x, it is strongly recommended to rewrite the code and use quotes in expressions everywhere. This will significantly reduce the number of possible errors. Any problems that occur while using the new features with LegacyExpressions enabled, but not without it, will not be considered a bug and will not be fixed.

en/autorun/documentation/directives.txt · Последнее изменение: 2024/03/27 13:27 — loopback

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki