Kay-

I've handled this before using more than one 32 bit int to store the
bits.  In my case it was for a Fusebox 3 login and permissions system.
 Basically, you break the bits into sts of 32 and use an addition
"level" column in the database. So, is you need postiion 100, that's
position 5 of the 4th level.  In other words:

level   positions
1       1-32
2       33-64
3       65-96
4       97-128

So you'd have 4 database entries representing positions 1-128, and all
you have to do in order to add more is to add more levels.  Further,
you can abstract all the logic required for this into a CFC, or into
the DB so that you are essentially just saying
rights.setRight(allowLogin,true).  The rights component knows
allowLogin is position [whatever], done some simple math to determine
what level that is, and sets the bit.

I may still have the code laying around somewhere from a presentation
I did on this concept at the Fusebox conference back in 2002...

-Cameron

On 8/29/06, Kay Smoljak <[EMAIL PROTECTED]> wrote:
> Hi everyone!
>
> I'm working on a project that will be using bit flags to indicate things like 
> status flags, categories and properties throughout the system. The database 
> designer has specified 64 bit integer fields for these and is talking about 
> possibly going higher, but according to the documentation ColdFusion's 
> bitwise functions only operate on 32 bit integers. Although I didn't do any 
> math past year 10 at high school, I'm pretty sure that means 31 possible 
> categories (discounting one bit for the sign), although the number of 
> *combinations* of categories is massive.
>
> I'm assuming the next step then is to look at Java equivalents to CF's 
> bitwise operators. Is there a wrapper CFC available (*hopeful*) or can anyone 
> give me any tips or pointers (or tell me I'm dumb and I've overlooked 
> something obvious)?
>
> Thanks heaps!
> K.
>
> --
> Kay Smoljak
> business: www.cleverstarfish.com
> standards: kay.zombiecoder.com
> coldfusion: kay.smoljak.com
> personal: goatlady.wordpress.com
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251487
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to