Language Constructs – Variables, Data Types and Arrays

By mrwhiteside

Today was an explanation in formal terms of things that, mostly, you already knew. You already knew them because you have been writing programs in visual basc that use variables, data types and (in the future) arrays.

I ran an example program called agein2020 which had one variable called age of type integer (the picture below shows what the code turns into when run).

data-type.jpg

We then looked at the different types you could set up:

Integer - positive and negative numbers (e.g. -56, 100, 45)

Single - numbers with a point (e.g. 3.14, 1.4)

String – any combination of words and letters (e.g. “EH10″, “Jamie”)

An array is a set of variables of the same type e.g. dim names(5) as string will create an array with 5 spaces in it.

arrays.jpgvariables.jpg

Tags:

Leave a Reply