Dynamic arrays

Sometimes we need to make an array that we are not sure of how many members will have. In this case should create dynamic arrays that, unlike the usual ones, do not have a fixed length. These arrays are declared in such a way that the number of members is omitted, and how many of them will be, or for how long the number of members of array should be increased is subsequently defined with commands that will be discussed in the text that follows.

Arrays

Arrays represent a group of variables of the same type. Since they often contain values that share common attributes, it is easier for us to assign them a unique name, and then to access each of them with an index number in a array. The index of the first member of an array is usually 0, and the index of the last one is smaller for one than the size of the array. It is possible to work with a whole array or with its individual members, they can be one or multi-dimensional …

Do Loop structure

Do-Loop structure, unlike For-Next loops, does not have built-in counter, for this purpose we have to declare one integer variable. Its value is increased in the loop body before or after the given statements, and checking the conditions on which it comes out of the loop is performed, in the case of the Do-While loop, at the beginning and in the case of the Do-Until loop at the end. Let’s see how to use these loops!

For-Next loop

Loops are structures that are used if we want to repeatedly execute given program code. The easiest to understand and probably most often used is the For-Next Loop. It is used when we know exactly how many times we want to repeat a particular action. First, the initial and the end value are set; we can also set the optional Step value for which counter is being incremented. Further we enter the programme code and in the end Next statement and a counter name.

Multiway branching

Sometimes it is necessary to examine the condition so that, depending on the result value, program offers multiple alternative actions. In this case, the Select-Case structure for multiway branching is used. It works by sending a parameter to it and, depending on its value, different parts of the program are executed. If the parameter value differs from all the alternatives offered the program code behind Else command is executed.