SetPropValue does not work with Boolean types
Original Reporter info from Mantis: red
-
Reporter name: Simon Ley
Original Reporter info from Mantis: red
- Reporter name: Simon Ley
Description:
SetPropValue gives an "Invalid variant type cast" when trying to set a boolean property, as it does not expect 'FALSE'/'TRUE' for values but rather 0 and 1.
Additional information:
uses
SysUtils, classes, typinfo, variants;
type
TBla = class(TPersistent)
private
fBool: Boolean;
published
property Bool: Boolean read fBool write fBool;
end;
begin
SetPropValue(TBla.Create, 'Bool', 'true');
end.
Mantis conversion info:
- Mantis ID: 9347
- Version: 2.3.1
- Fixed in version: 2.2.2
- Fixed in revision: 8462 (#e11816c3)