Data structures

If the program needs to remember one item of data, you need a variable.

If the program needs to store a list of related items of data, you need an array.

You will need to decide on the data type:
  • String for anything with text in it
  • Integer or Long for whole numbers
  • Single or Double for real numbers (numbers with a decimal point)
  • Boolean for True/False values
Example code – declaring a variable     show
Example code – declaring an array to store 10 items     show
Example code – traversing an array     show
Generate your own VB code:
What do you need to store?
Single item
List of related items
What type of data is it?
Text
Whole number
Decimal number
True or False
Enter a name for what needs to be stored:


Back to index

mph@ghscomputing.co.uk

Updated 09 December 2018