at the end of this lab exercise
TRANSCRIPT
-
7/28/2019 At the End of This Lab Exercise
1/3
DISCUSSION:
At the end of this lab exercise, we have run the see how array function on V.B 2008. Arrays
occupy space in memory. The programmer specifies the array type and the number of elements
required by the array so that the compiler may reserve the appropriate amount of memory.
Arrays may be declared as Public (in a code module), module or local. Module arrays aredeclared in the general declarations using keyword. Local arrays are declared in a procedure
using Dim or Static. Array must be declared explicitly with keyword "As". Array are for storing
variable data in fixed or dynamic size. It can be programmed by programmer to make it fixed or
not. For example, if we need to enter one hundred names, it is difficulty to declare 100 different
names, this is a waste of time and efforts. So, instead of declaring one hundred different
variables, we need to declare only one array. We differentiate each item in the array by using
subscript, the index value of each item, for example name(1), name(2),name(3) .......etc. , which
will make declaring variables streamline and much systematic. To do the array, we must first
declare the array name and the data type. After that we must have number of element. As an
example:- Dim Politeknik(15) As String. Politeknik is the variable array name. String is the data
type for the array that mean it will store text. The number of element is 16 where its start from 0
to 15. Array can be set with unknown number. Just put the blank bracket after array name. Array
usually can be on one dimensional and multidimensional array. A two dimensional array is a
table of items that make up of rows and columns. The format for a one dimensional array is
ArrayName(x), the format for a two dimensional array is ArrayName(x,y) and a three
dimensional array is ArrayName(x,y,z) . Normally it is sufficient to use one dimensional and two
dimensional array ,you only need to use higher dimensional arrays if you need to deal more
complex problems. To simplify working with array, ubound (upper boundary) is use to check the
top index of the array. With that, we can process array without refer the declaration statement ofthe project that define how many value the array can hold.
One dimensional ArrayStudent
NameName(1)Name(2)Name(3)Name(4)Name(5)Name(6)
Two Dimensional Array
Name(1,1)Name(1,2)Name(1,3)Name(1,4)Name(2,1)Name(2,2)Name(2,3)Name(2,4)Name(3,1)Name(3,2)Name(3,3)Name(3,4)
-
7/28/2019 At the End of This Lab Exercise
2/3
CONCLUSION:
In this lab exercise, we have run the array function on VB 2008. We have learn the function of
array and the application on the VB. Actually, array is use to organize the variable number of
data that will be keep by user. So the number of element sometime will be declare by
programmer or it will be infinity. So array is use to organize the variable number of data. It havefixed and dynamic array. Two types of arrays in Visual Basic namely Fixed-size array. The size
of array always remains the same-size doesn't change during the program execution. Dynamic
array, The size of the array can be changed at the run time- size changes during the program
execution.The number of element can be on the bracket ( ). To organize many number of array,
two dimensional array is use. It will use combination of rows and column to get the data,
different from one dimensional array. To simplify working with array, ubound is use to check the
top index of the array.
-
7/28/2019 At the End of This Lab Exercise
3/3
REFERRENCES:
Microsoft Visual Basic 2008(Step By Step) By Michael Halvorson
http://www.vbtutor.net/vb6/lesson16.html
http://msdn.microsoft.com/en-us/library/vstudio/wak0wfyt.aspx
http://visualbasic.freetutes.com/learn-vb6/lesson6.html
http://www.vbtutor.net/vb6/lesson16.htmlhttp://www.vbtutor.net/vb6/lesson16.htmlhttp://msdn.microsoft.com/en-us/library/vstudio/wak0wfyt.aspxhttp://msdn.microsoft.com/en-us/library/vstudio/wak0wfyt.aspxhttp://visualbasic.freetutes.com/learn-vb6/lesson6.htmlhttp://visualbasic.freetutes.com/learn-vb6/lesson6.htmlhttp://visualbasic.freetutes.com/learn-vb6/lesson6.htmlhttp://msdn.microsoft.com/en-us/library/vstudio/wak0wfyt.aspxhttp://www.vbtutor.net/vb6/lesson16.html