// 获取类型
function VarType(const V: Variant): TVarType;VarType Contents of variantvarEmpty The variant is Unassigned.
varNull The variant is Null.
varSmallint 16-bit signed integer (type Smallint).
varInteger 32-bit signed integer (type Integer).
varSingle Single-precision floating-point value (type Single).
varDouble Double-precision floating-point value (type Double).
varCurrency Currency floating-point value (type Currency).
varDate Date and time value (type TDateTime).
varOleStr Reference to a dynamically allocated UNICODE string.varDispatch Reference to an Automation object (an IDispatch interface pointer).
varError Operating system error code.
varBoolean 16-bit boolean (type WordBool).
varVariant A variant.
varUnknown Reference to an unknown OLE object (an IInterface or IUnknown interface pointer).
varShortInt 8-bit signed integer (type ShortInt)
varByte A Byte
varWord unsigned 16-bit value (Word)
varLongWord unsigned 32-bit value (LongWord)
varInt64 64-bit signed integer (Int64)varStrArg COM-compatible string.
varString Reference to a dynamically allocated string (not COM compatible).
varAny A CORBA Any value.
function VarType(const V: Variant): TVarType;VarType Contents of variantvarEmpty The variant is Unassigned.
varNull The variant is Null.
varSmallint 16-bit signed integer (type Smallint).
varInteger 32-bit signed integer (type Integer).
varSingle Single-precision floating-point value (type Single).
varDouble Double-precision floating-point value (type Double).
varCurrency Currency floating-point value (type Currency).
varDate Date and time value (type TDateTime).
varOleStr Reference to a dynamically allocated UNICODE string.varDispatch Reference to an Automation object (an IDispatch interface pointer).
varError Operating system error code.
varBoolean 16-bit boolean (type WordBool).
varVariant A variant.
varUnknown Reference to an unknown OLE object (an IInterface or IUnknown interface pointer).
varShortInt 8-bit signed integer (type ShortInt)
varByte A Byte
varWord unsigned 16-bit value (Word)
varLongWord unsigned 32-bit value (LongWord)
varInt64 64-bit signed integer (Int64)varStrArg COM-compatible string.
varString Reference to a dynamically allocated string (not COM compatible).
varAny A CORBA Any value.
TObject.ClassName: ShortString; 可以
Edit1.Text := MyObj.ClassName;
问题:
1、传入参数类型应是什么?(variant行吗?)
2、调用vartype返回的是TVARTYPE类型,如何将返回值转换成字符串在MESSAGEBOX中显示?我学习DELPHI时间不常,问的很蠢的地方不要见笑!谢谢!
另:可否留下QQ,MAIL之类联系方式,便于交流!