Error handling

Errors happen! If there is a critical place in the program where we think that an error may occur it is necessary to mark it and further redirect the program flow to the message that should be displayed if it occurs. For managing the program flow, with and without error, we can use the GoTo command. In combination with On Error we get a powerful tool that helps us take the necessary action immediately after the error is detected.

Variable scope and lifetime

The variable, after declaration, has its own lifespan and it lasts until the subroutine in which it was created is completed. Sometimes we want her to keep its value even after leaving the subroutine. Also, the variable is visible only within the module in which the it is located. Is there a need for it to be seen outside the module? How to define the range and extend the life span of variables will be found in the text that follows.

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!