0 Members and 3 Guests are viewing this topic.
function GetTypeOF(Value: variant): string;begin case VarType(Value) of 3 : Result:= IntToStr(Value); 5 : Result:= FloatToStr(Value); 11 : Result:= iif(Value, 'true', 'false'); 256: Result:= Value; end;end;
thanks, ill put it into search and found it Code: [Select]function GetTypeOF(Value: variant): string;begin case VarType(Value) of 3 : Result:= IntToStr(Value); 5 : Result:= FloatToStr(Value); 11 : Result:= iif(Value, 'true', 'false'); 256: Result:= Value; end;end;it was from curry wurst d:
function int(value: variant): integer;begin case VarType(value) of 3: Result := value; 5, 17: Result := Round(value); 256: Result := StrToInt(Value); end;end;function str(value: variant): string;begin case VarType(value) of 3: Result := IntToStr(value); 5, 17: Result := FloatToStr(value); 256: Result := value; end;end;function float(value: variant): single;begin case VarType(value) of 3: Result := value; 5, 17: Result := value; 256: Result := StrToFloat(value); end;end;