Chapter 8 Summary

Chapter 8 Summary - Chapter 8 Summary Chapter 8 Arrays and...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 8: Arrays and More 8.1 Arrays Concept: An array is a group of variables with one name. This are accessed via a subscript All variable in an array must be of the same type. Declaring an array Dim ArrayName (Uppersubscript) as DataType The subscript is the highest value in the array. Dim intDays(30) as integer The above would declare the array intDays of the type integer. Because numbering starts at zero, there would be 31 values. It is possible to omit the subscript and declare it using implicit array sizing. For instance: Dim intDays() as integer = { 1, 2, 3, 4, 5, 6, 7, 8} The number 1 is stored at element zero, 2 at element 1, etc. Named constants If a value will not change, named constants may be used. Const intUPPER_LIMIT as integer = 25 This would assign the value 25 to UPPER_LIMIT and would not change The array would be: Dim intArray(intUPPER_LIMIT) as integer Loops may be used to access elements Const intUPPER_LIMIT as integer = 25 Dim intArray(intUPPER_LIMIT) as integer Dim intCount as integer For intCount = 0 to intUPPER_LIMIT
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/05/2011 for the course BUS 92 taught by Professor Staff during the Spring '11 term at San Jose State.

Page1 / 4

Chapter 8 Summary - Chapter 8 Summary Chapter 8 Arrays and...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online