Syntax |
[Let] variable = expression |
Description |
Assigns the result of an expression to a variable. |
Comments |
The use of the word Let is supported for compatibility with other implementations of the Basic Control Engine. Normally, this word is dropped. When assigning expressions to variables, internal type conversions are performed automatically between any two numeric quantities. Thus, you can freely assign numeric quantities without regard to type conversions. However, it is possible for an overflow error to occur when converting from larger to smaller types. This happens when the larger type contains a numeric quantity that cannot be represented by the smaller type. For example, the following code will produce a runtime error: Dim amount As Long amount = 400123 'Assign
a value out of range for int. When performing an automatic data conversion, underflow is not an error. |
Example |
Sub Main() |
See Also |
= (keyword); Expression Evaluation (topic). |
L |