Scripts allow you to implement almost any application logic, interact with visual components and the database.

In addition, there are a large number of classes with different purposes, such as file management, graphics, timers, etc.


At the same time, you can create a full-fledged accounting program without using scripts.


In order to use scripts in your project, you just need to click on the button  on the toolbar, after that the "Script" tab will appear, where you will write scripts. You will also see an additional "Events" tab in the "Object inspector" panel.





The figure shows an example of a simple script that shows a greeting message when the project starts, and also shows a greeting when the Button1 button is pressed.

Quite often you will need to use events from various components. Let's look at an example.

Note the event handler: procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);

It was created as follows, go to the tab "Events", and double-click on the blank line, opposite the event you want, in our case OnClick.

The name of the procedure for the event will be generated automatically, and now between the keywords begin and end; you can write the necessary script that will be executed when this event occurs, for example, when the user clicks on this button.

Each visual component has many kinds of events with which you can implement the program behavior you want.