Just seen a post on StackOverflow that is poorly described but got me thinking (the poster refers to RO SDK)
so assume:
TFoo = class (TROComplexType)
...
published
property CanEdit: Boolean read fCanEdit write fCanEdit;
end;
TROStreamSerializer treats boolean true as a value of 255
and looking into TROStreamSerializer.ReadEnumerated I see that the value of fCanEdit would be set to 255 if fCanEdit should be true.
Good so far, except:
var
temp : Boolean;
begin
// De-serialize Foo from a stream and CanEdit is set to True
Assert (Foo.CanEdit);
temp := not Foo.CanEdit;
// temp is true
Inspect the memory and you will see:
Byte (Foo.CanEdit) = 255
Byte (Temp) = 254
Ouch, boolean evaluation on boolean property of TROComplexType does not work as one would expect.
The poster appears to have solved his/her problem, but thought it would be prudent to show what I found contemplating said posters problem.
As a side note I have a fairly oldish version of RO SDK, so maybe it’s already fixed, don’t know.