From: Colin Fraser [mailto:[EMAIL PROTECTED]]
> So if I had a type TSomeTime = set of (stOne, stTwo, stThree),
> then I had a var SomeType: TSomeType,
> then I could go something like SomeType := [stOne, stTwo] and somehow
> convert this to an integer to store in a DB...
> 
> But, the compiler doesn't like this, works ok for enumerated types, but
not
> for a set of them.

type
  TSomeType = set of (stOne, stTwo, stThree);
  TSomeTypeSet = set of TSomeType;

var SomeType: TSomeTypeSet;

    SomeType := [stOne, stTwo];

    Query1.FieldByName('SomeType').AsInteger := Byte(SomeType);

    LByte := Query1.FieldByName('SomeType').AsInteger;
    SomeType := TSomeTypeSet(LByte);

Cheers,
Carl
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to