함수를 실행하려는데..
인자의 형태가 정해져 있지 않는 경우 아래를 참고하세요..
From 류..
---------
Function DoWithVarType(a:Variant):String;
begin
Case VarType(a) of
varEmpty : Result:= 'The variant is Unassigned.';
varNull : Result:= 'The variant is Null.';
varSmallint : Result:= '16-bit signed integer (type Smallint).';
varInteger : Result:= '32-bit signed integer (type Integer).';
varSingle : Result:= 'Single-precision floating-point value (type Single).';
varDouble : Result:= 'Double-precision floating-point value (type Double).';
varCurrency : Result:= 'Currency floating-point value (type Currency).';
varDate : Result:= 'Date and time value (type TDateTime).';
varOleStr : Result:= 'Reference to an OLE string (a dynamically allocated Unicode string).';
varDispatch : Result:= 'Reference to an OLE automation object (an IDispatch interface pointer).';
varError : Result:= 'Operating system error code.';
varBoolean : Result:= '16-bit Boolean (type WordBool).';
varVariant : Result:= 'Variant (used only with variant arrays).';
varUnknown : Result:= 'Reference to an unknown OLE object (an IUnknown interface pointer).';
varByte : Result:= '8-bit unsigned integer (type Byte).';
varString : Result:= 'Reference to a dynamically allocated long string (type AnsiString).';
varTypeMask : Result:= 'Bit mask for extracting type code.';
varArray : Result:= 'Bit indicating variant array.';
Else Result:= 'Reference to an unknown OLE object (an IUnknown interface pointer).';
End;
end;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(DoWithVarType('Hello'));
ShowMessage(DoWithVarType(1));
ShowMessage(DoWithVarType(1.0));
end;
|