The Goals of this Module

■ Understand the assignment operator

■ Know type conversions, their risks, and the effect on them of Option Strict

■ Understand the arithmetic operators

■ Use the InputBox function and its return value

While variables must be declared, since the purpose of a variable is to store a value, a declared variable without an assigned value is like me in my high school dating years: all dressed up but no place to go. While there was no solution for my problem, assigning a value to a variable or property is easy using the assignment operator.

There is overlap among data types. For example, there are several data types that may represent a whole number. Intentionally or unintentionally, you may attempt to assign a value of one data type to a variable or property of a similar but not identical data type. To perform this assignment, the data type of the value must be converted to that of the variable or property. This is called type conversion, and it can be tricky. This module will show you the rules involved.

Computers, in addition to being able to store vast amounts of data, can calculate far faster and more accurately than we can. You harness the computer's calculating ability using arithmetic operators.

Finally, instead of supplying in code the value that is assigned, you can use the InputBox function to enable your application's user to input that value, which then, as the return value of the function, is assigned to a variable or property.

Was this article helpful?

0 0

Post a comment