Arrays: part1 An array is a collection of simple variables of the same type to which the computer can efficiently assign a list of values. An array is a consecutive group of memory locations that all have the same name. To refer to a particular location or element in the array, we specify the array name and the array element position number. The Individual elements of an array are identified using an index. Declaring arrays: Arrays may be declared as Public (in a code module), module or local. Module arrays are declared in the general declarations using keyword Dim or Private. Local arrays are declared in a procedure using Dim. There are two types of arrays in Visual Basic namely: Fixed size, Dynamic Size. Fixed-Size Array: The size of array always remains the same size doesn t change during the program execution. When an upper bound is specified in the declaration. This type is divide to (One Dimensional Array & Multi-Dimensional Array). Dynamic array : The size of the array can be changed at the run time 2 For example: Public A(14) As Integer “ an array of 15 elements “ Public a(100) As Integer “ an array of 101 elements “ Dim Student(20) As String “ an array of 21 elements “ Dim Counter(9) As Integer “ an array of 10 elements “ Another form: Dim Num(5) As Integer Num is the name of the array, and the number 5 included in the brackets is the upper limit of the array, means the above declaration creates an array with 6 elements, with index numbers running from 0 to 5 . Num(5) Num(0) Num(1) Num(2) Num(3) Num(4) Num(5) Value 3.1 7 -10 2 0.33 6 If we want to specify the lower limit, then the brackets should include both the lower and upper limit along with the To keyword, an example for this is given below. is equal to Dim Num(0 To 5) As Integer Dim Num(5) As Integer
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|