SRL Archive - SRL Archives

VariantToStr


Da 0wner

2009-03-04 22:56:35


function VariantToStr(v : variant) : string;
begin
if (not VarIsEmpty(v)) and (not VarIsNull(v)) then
begin
case VarType(v) of
256 : result := v;
3 : result := IntToStr(v);
5 : result := FloatToStr(v);
11 : result := BoolToStr(v);
end;
end;
end;

bullzeye95

2009-03-04 23:05:16

Variants are automatically converted to strings if need be.

Da 0wner

2009-03-04 23:33:15

Oh wow. Somehow, I tried to do it it gave me a type mismatch. Yeah, I see it's true. Nevermind then just don't use this lol I'm an idiot..