Compound command

A compound command is one command composed of multiple commands followed by one another closed between the begin and end key words and ended with a semicolon (Figure 52). It is used wherever Lazarus allows writing only one command (e. g. For-loop, which we will become familiar with in the next chapter). 

Figure 52: Compound For-loop command
Figure 52: Compound For-loop command

In the Figure we see marked begin and end, between which three commands are closed. These three commands (pen thickness and colour settings and rectangle command) represent one compound command as they form a single piece of multiple parts.

A special case of a compound command is the body of the program that we have already become familiar with in the previous chapters (e. g. Figure 30).

The establishing of a compound command appears to be superfluous at first glance. Commands between begin and end can be implemented in a given order. The fundamental difference is that it is a single command. If the rules of Lazarus, respectively Pascal, allow only one command in some constructions command and we need to do more, we can say that we create them command stacked. 

Vytvorte si webové stránky zdarma! Táto stránka bola vytvorená pomocou služby Webnode. Vytvorte si vlastný web zdarma ešte dnes! Vytvoriť stránky