Last active
December 29, 2020 19:02
-
-
Save JTheiller/c75e77462b46ff66d4653ed7b8f15ae4 to your computer and use it in GitHub Desktop.
Return the variante type in string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uses Variants | |
function VarTypeToStr(Value: Variant): String; | |
begin | |
Result := VarTypeAsText(VarType(Value)); | |
end; | |
//or | |
function VarTypeToStr(Value: Variant): String; | |
var | |
typeString : string; | |
basicType : Integer; | |
begin | |
Result := 'varTypeNotFound'; | |
basicType := VarType(Value) and VarTypeMask; | |
case basicType of | |
varEmpty : Result := 'varEmpty'; | |
varNull : Result := 'varNull'; | |
varSmallInt : Result := 'varSmallInt'; | |
varInteger : Result := 'varInteger'; | |
varSingle : Result := 'varSingle'; | |
varDouble : Result := 'varDouble'; | |
varCurrency : Result := 'varCurrency'; | |
varDate : Result := 'varDate'; | |
varOleStr : Result := 'varOleStr'; | |
varDispatch : Result := 'varDispatch'; | |
varError : Result := 'varError'; | |
varBoolean : Result := 'varBoolean'; | |
// Valueiant : Result := 'Valueiant'; | |
varUnknown : Result := 'varUnknown'; | |
varByte : Result := 'varByte'; | |
varWord : Result := 'varWord'; | |
varLongWord : Result := 'varLongWord'; | |
varInt64 : Result := 'varInt64'; | |
varStrArg : Result := 'varStrArg'; | |
varString : Result := 'varString'; | |
varAny : Result := 'varAny'; | |
varTypeMask : Result := 'varTypeMask'; | |
end; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment