Limitations to usage of the Goto operator





This article describes the standards that apply to the usage of the Goto operator. All of the listed recommendations are mandatory unless noted otherwise.

This recommendation is optional

1. We recommend that you do not use the Goto operator because this might impact the clarity of your module structure, making the connections between script fragments and the order of their excution harder to understand. We recommend that you use other 1C:Enterprise script operators instead.

 

Incorrect:

 If ChartOfCalculationTypes = Object.ChartOfCalculationTypes Then
  
  Goto ~ChartOfCalculationTypes;
  
 EndIf;

 

Correct:

 If ChartOfCalculationTypes = Object.ChartOfCalculationTypes Then
  
  ProcessChartOfCalculationTypes();
  
 EndIf;

2. Do not use the Goto operator in common modules with the Client (managed application) flag, command modules, and client script of managed form modules because 1C:Enterprise web client does not support this operator.


Comments
0
Add comment