Compilation directives

In the previous lesson you created handlers for OnChange events of some form controls. The generated declarations of the handler procedures were preceded by &AtClient directives. Here we will explain their meaning.

A form exists simultaneously on the server and on the client. So for each procedure in the form module you have to explicitly specify its execution context, in other words, where it is executed: on the server or on the client. Availability of the &AtClient, &AtServer, and &AtServerNoContext directives reflects the fact that when 1C:Enterprise script is used in a form module, the client script must be clearly separated from the server script. So when you specify one of the directives, you specify a client or a server part of the program.

You can use procedures with different execution directives within a single form module and you can pass script execution from the client to the server. You can also call a common module procedure from a client procedure (which is exactly what you did earlier in this tutorial), and that common module procedure can be executed either on the client or on the server, depending on the values of the Client and Server module properties.

Next page: Script execution on the client and on the server

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.