December 2001
Beginner
976 pages
22h 4m
English
When the compiler encounters an assignment statement it will ensure that the data type of the variable being assigned matches the type of the value being assigned to it. If the two are not of the same type it will verify that the two types are compatible, that is, the compiler can implicitly convert the value into the variable data type. This is called an implicit conversion. If this is not the case a syntax error will be raised—the program is invalid (cannot be compiled).
For example the following code will compile and run correctly:
Dim i As Integer, d As Double d = i
While the next lines of code will not compile:
Dim i As Integer, d As Double i = d
You will notice the fact that d is underlined, and if you place ...
Read now
Unlock full access