Arr...
Thanks, that did it, I was casting to an integer (which works for enumerated
types) and not to a Byte...
The Byte did the trick...
Regards
Colin
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Carl Reynolds
Sent: Thursday, 25 January 2001 4:08 pm
To: Multiple recipients of list delphi
Subject: RE: [DUG]: FW: Storing enumerated sets in a db...
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"
######################################################################
Attention:
The information in this email and in any attachments is confidential.
If you are not the intended recipient then please do not distribute,
copy or use this information. Please notify us immediately by return
email and then delete the message from your computer.
Any views or opinions presented are solely those of the author.
######################################################################
---------------------------------------------------------------------------
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"