Colin
Have a look at this
http://www.delphizine.com/features/2000/04/di200004rl_f/di200004rl_f.asp
it uses rtti to converts enum sets to strings and back
so you could for TSomeTime = set of (stOne, stTwo, stThree),
var
SomeType: TSomeType;
SomeType := [stOne, stTwo]
Store it in the db as 'stOne, stTwo' which means you can string ops like
LIKE
Even if you want to store in in a BINARY then the article tells you the
pitfalls of enum types in delphi
(mainly offsets)
HTH
Neven
----- Original Message -----
From: Colin Fraser <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Thursday, 25 January 2001 13:35
Subject: [DUG]: FW: Storing enumerated sets in a db...
>
> Hi all...
>
> I have an enumerated set that I want to store in a db... I was assuming
that
> the items in the set could be converted to an integer. I thought each item
> in the set was like a logical bit (and that was why the number of items in
a
> set was restricted).
>
> 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.
>
> Any tips on a nice way of storing a set type in a database field???
>
> Any suggestions welcome.
>
> Regards
>
> Colin
>
>
> ######################################################################
> 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"
>
---------------------------------------------------------------------------
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"