在VB中可变类型变量的使用
摘要:在
VB
中变量的数据类型有很多种类,如字符
型串型、数值型、日期型、布尔型等。还有一种特殊类型:
可变类型
(
Variant
)
。
定义了一个可变类型变量后,
该变量可
以存放任何类型的数据(数值、字符、日期等)
,这样在给
变量赋值时就不用对数据进行转换了,
VB
系统会根据赋给
变量的值的不同自动进行数据类型的转换。
关键词:变量;数据类型;可变类型;程序设计
中图分类号:
TP311
文献标识码:
A
文章编号:
1009-3044(2008)26-1720-02
Variant Variables Use In Visual Basic
WANG Jin-feng
(Wuhan Engineering Institute, Wuhan 430415, China)
Abstact: Variables data type in Visual Basic is of many
types such as string,numeric,date,boolen etc. And among them is
Variant, a special type. A variables which is defined by the
variant can be stored with any type of data (numeric,string, date
and so on).Therefore,it is not necessary for usto make any
conversion between data types, because Visual Basic can do so
automatically according to the value of defined variables.
Key words: variables; data type; variant; programming