Value Types and Reference Types
There are two types of data types in ViviFire: reference types and value types. A variable of a reference type stores a reference to its data object, while a variable of a value type directly contains its data. With reference types, two variables can refer to the same object. Thus, operations on one variable can have an effect on the object that the other variable refers to. With value types, each variable has a copy of the data. Thus, it is usually not possible for operations on one variable to have an effect on a different variable. It is possible only with the modifier ByRef on parameters.
Value types
- All numeric data types
Boolean
,Char
, andDateTime
- All structures, although their members can be reference types
- Enumerations, because they are equivalent to integer types
Reference types
- All arrays, although their members can be value types
- Class types
Elements that are not types
- Modules and namespaces
- Properties and procedures
- Variables, constants, and fields