- Patch from Jesus Reyes:

* TFloatField.SetAsString doesn't look at DecimalSeparator for
    converting a string into a Float
  * TBooleanField.SetAsString won't accept an empty string as a valid
    value, also the patch allows strings as T, F or any starting
    substring of DisplayValues to be accepted.
This commit is contained in:
michael 2005-05-12 18:52:32 +00:00
parent 1b64ac5ac0
commit e5431e6db2

View File

@ -1391,14 +1391,14 @@ end;
procedure TFloatField.SetAsString(const AValue: string); procedure TFloatField.SetAsString(const AValue: string);
Var R : Double; Var R : Double;
Code : longint;
begin begin
Val(AVAlue,R,Code); try
If Code<>0 then R := StrToFloat(AValue);
DatabaseErrorFmt(SNotAFloat,[AVAlue])
Else
SetAsFloat(R); SetAsFloat(R);
except
DatabaseErrorFmt(SNotAFloat, [AValue]);
end;
end; end;
procedure TFloatField.SetVarValue(const AValue: Variant); procedure TFloatField.SetVarValue(const AValue: Variant);
@ -1487,9 +1487,11 @@ Var Temp : string;
begin begin
Temp:=UpperCase(AValue); Temp:=UpperCase(AValue);
If Temp=FDisplays[True,True] Then if Temp='' then
Clear
else if pos(Temp, FDisplays[True,True])=1 then
SetAsBoolean(True) SetAsBoolean(True)
else If Temp=FDisplays[True,False] then else if pos(Temp, FDisplays[True,False])=1 then
SetAsBoolean(False) SetAsBoolean(False)
else else
DatabaseErrorFmt(SNotABoolean,[AValue]); DatabaseErrorFmt(SNotABoolean,[AValue]);
@ -2308,7 +2310,15 @@ end;
{ {
$Log$ $Log$
Revision 1.33 2005-04-26 16:48:58 michael Revision 1.34 2005-05-12 18:52:32 michael
- Patch from Jesus Reyes:
* TFloatField.SetAsString doesn't look at DecimalSeparator for
converting a string into a Float
* TBooleanField.SetAsString won't accept an empty string as a valid
value, also the patch allows strings as T, F or any starting
substring of DisplayValues to be accepted.
Revision 1.33 2005/04/26 16:48:58 michael
* Some patches from Uberto Barbini * Some patches from Uberto Barbini
+ TLoginEvent more Delphi compatible (D5 and bigger). + TLoginEvent more Delphi compatible (D5 and bigger).
* AsCurrency Property for TField. * AsCurrency Property for TField.