为什么当 Set 由属性提供时 System.Include 不起作用?
TMyItem = (miOne, miTwo, miThree);
TMyItems = set of TMyItem;
TSomeClass = class
private
FItems: TMyItems;
protected
procedure SetItem(val : TSetItems);
function GetState : TSetItems;
public
property Items : TMyItems read GetMyItems write SetMyItems;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
c: TSomeClass;
begin
c:=TSomeClass.Create;
c.Items:=c.Items + [miTwo]; //WORKS OK
Include(c.Items,miTwo); //COMPILE ERROR
end;
我使用的是 Win32 BDS 2006。这是错误、功能还是操作错误?
谢谢,戴夫