Page 6 - revision
P. 6
Orouba Language Schools Third Preparatory
Computer Department Second Term 2017/2018
Items It is a property that is used to add items shown to the ComboBox
control.
Chapter 3 Loops and Procedure
For ... Next It is one of the limited loop statements used when we want to
Step repeat a code for specific number of time.
Next
General syntax for this statement
Do While ... Loop For Variable = Start Value To End Value Step Add Value
Procedures
Code
Final Revision Next [Variable]
Notes: The starting value, the end value, or the increase rate can
be an integer or a decimal number according to the data’ types.
Using the (Step) keyword, you can increment or decrement the
value of the counter; by the value that is specified.
If you do not write (Step) with the (For ...Next) statement, it
means that the increment value is one by default.
The value after (Step) should be negative if the starting value is
greater than the end value
The value after (Step) can be a numeric value or numeric
variable.
It’s the end of the loop where the program execution returns to
"For statement" Its function:
a) Compare the counter’s value with the end value of the loop
b) Increase or decrease the value of the counter variable
according to the value of Step.
Note: Typing a variable name (counter) next to "Next " is
optional
The statement 'Do while ... loop' is used to repeat a specific code
for a several times of an unknown end, but based on a specific
condition, so they are useful if you do not know the number of
iterations emphatically.
The general syntax of this statement is:
Do While Conditional Expression
Code
Loop
Note: The code between the beginning of the loop "Do While"
and its end will be implemented as long as the conditional
expression is true. If the condition is not met for any reason,
we get out of the iterative loop, and implement the code after
“Loop” if found.
A set of commands and instructions under a name, can be
recalled by that name, so as to implement them, and create a
6