Sequence

Sequence is the most commonly used programming structure. It is a sequence of the individual components, which together represent one whole. We will use it if there are commands to do the order in which they are written, i. e. command after command (sequential executing commands is a basic feature of all computer programs). The sequence consists of one or several steps that are executed once.

A simple example of a sequence is drawing a rectangle in which we can adjust the thickness and colour of the pen and fill colour while the commands are executed one by one (Figure 25, chapter Graphic area). 

In the first step, the graphical area is deleted in white, in the second step the program sets the colour of the pen to blue; the next step sets the pen thickness to 15, and then sets the colour of the brush to red. In the last step, a rectangle with the given coordinates is plotted on the graphic canvas. After the execution of all the commands, the program ended (Figure 26). 

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