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 execution 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.

Next page: PredefinedValue function usage specifics


Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.