摘要
Variant是 VB2 .0及其以后版本的缺省数据类型 ,它是 VB中的一种特殊的数据类型 ,可以包含数值、字符串或日期数据 ,还可以包含特殊数值 Empty、Error及 Null等。Variant变量能够存储所有系统定义类型的数据。如果把它们赋予 Variant变量 ,则不必在这些数据的类型间进行转换 ,Visual Basic会自动根据上下文完成任何必要的转换。这样我们可以使用 Variant来替换任何数据类型 ,从而更有适应性。虽然使用方便灵活 ,但是 Variant比其它数据类型所占内存大 ,并且运行速度慢 ,应该有限制地使用。
In VB2.0 and higher version, Variant is a default data type. The Variant is a special data type of Visual Basic that can contain numeric, string, or date data types. A Variant can also contain the special values Empty, Error, and Null. The Variant data type allows us to store most types of data. We don′t have to convert between these data types if they are assigned as Variant variables, for the Visual Basic automatically performs any necessary conversion depending on the context. We can use the Variant data type in the place of any data type to work with data in a more flexible way. Although it is flexible, it needs larger storage room and has slower computing efficiency than that other data types do. It should thus be used restrainedly.
出处
《物探化探计算技术》
CAS
CSCD
2001年第2期171-175,共5页
Computing Techniques For Geophysical and Geochemical Exploration