Presentation is loading. Please wait.

Presentation is loading. Please wait.

Visual Basic.net Arrays. Single Dimension Array An array is a series of individual variables, all referenced by the same name Sometimes arrays are referred.

Similar presentations


Presentation on theme: "Visual Basic.net Arrays. Single Dimension Array An array is a series of individual variables, all referenced by the same name Sometimes arrays are referred."— Presentation transcript:

1 Visual Basic.net Arrays

2 Single Dimension Array An array is a series of individual variables, all referenced by the same name Sometimes arrays are referred to as tables or subscripted variables

3 Array Elements An example of a string array named strName strName(0) strName(1) strName(2) … *note each individual variable is known as an element of the array

4 Declaring an array (Syntax) Dim ArrayName([LowerSubscript to] UpperSubscript) [As DataType] Dim strName(0 to 9) as String ‘ 10 element array Dim curBalance(10) as Currency ‘ 10 element array Dim gstrProduct(1 to 100) as String ‘ 100 element array These are some examples of arrays declaration

5 String Array (example) Sam Neil John Wayne Casey Weldon Drew Barrymore Britney Spears Nicole Kidman Ashley Judd Nicolas Cage William Shatner Natalie Portman 0 1 2 3 4 5 6 7 8 9 srtName(0 to 9)

6 Multiple Dimension Array Used to store two subscripts that Identifies tabular data, where data is arranged in rows and columns Examples: Insurance rate tables, tax tables, postage rates, etc.

7 Multidimensional Array (Syntax) Dim ArrayName (LowerLimit To] UpperLimit, [LowrrLimit To] UpperLimit) As Datatype Example: Dim strName(2, 3) As String Dim strName(0 to 2, 0 to 3) as String Both of these statements establishes an array of 12 elements

8 Multidimensional Array (Example) (0,0)(0,1)(0,2)(0,3) (1,0)(1,1)(1,2)(1,3) (2,0)(2,1)(2,2)(2,3) strName(0 to 2, 0 to 3)


Download ppt "Visual Basic.net Arrays. Single Dimension Array An array is a series of individual variables, all referenced by the same name Sometimes arrays are referred."

Similar presentations


Ads by Google