Type | Scope | Severity | Activated by default |
Minutes to fix |
Tags |
---|---|---|---|---|---|
Code smell |
BSL OS |
Major |
Yes |
5 |
standard design unpredictable |
In most scenarios, we recommend that you do not use global variables and use other 1C:Enterprise script tools instead. Since monitoring the visibility (usage) areas of such variables is tricky, they often might cause issues that cannot be easily located.
Variable FileConversion Export;
Procedure BeforeWrite(Cancel)
If FileConversion Then
...
EndProcedure
We recommend that you use the AdditionalProperties object property for passing parameters between event subscription handlers and for passing parameters from external script to object module event handlers
Procedure BeforeWrite(Cancel)
If AdditionalProperties.Property("FileConversion") Then
...
EndProcedure
// script that calls the procedure
FileObject.AdditionalProperties.Insert("FileConversion", True);
FileObject.Write();
Standard: Using global variables in modules
// BSLLS:ExportVariables-off
// BSLLS:ExportVariables-on
"ExportVariables": false