Home > Archive > PHP Language > July 2004 > Bit level flagging
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Bit level flagging
|
|
| -maniax- 2004-07-21, 3:56 pm |
| Hi Folks
I'm trying to use a variable as a condition flag and I want to set or clear
various bits in the variable as certain conditions occur.
In my dim and distant past I used a language (BBC Basic) that allowed you to
use booloean functions (AND, OR, NOT, EOR etc) to compare and modify
variables at a binary/bit level (see the "AND" operator here
http://www.rtrussell.co.uk/products/bbcbasic/manual for an example)
I've had a quick trawl through the PHP manual but can't see any indication
that there are any built in PHP functions or operators that provide this
sort of feature although it's possible that I'm not looking under the
correct names.
Before I go down the route of writing my own functions to provide these
features can anyone point me in the direction of any buit in PHP functions
that would do the job or failing that any user written functions.
Regards
-maniax-
| |
| -maniax- 2004-07-21, 3:56 pm |
| Hi Again
Sorry I posted the wrong example link
Try this one instead
http://www.cix.co.uk/~rrussell/prod...bckey1.html#and
Regards
-maniax-
"-maniax-" <dont.even.think@about.it> wrote in message
news:GRvLc.526$mO6.231@newsfe2-gui.ntli.net...
> Hi Folks
>
> I'm trying to use a variable as a condition flag and I want to set or
clear
> various bits in the variable as certain conditions occur.
>
> In my dim and distant past I used a language (BBC Basic) that allowed you
to
> use booloean functions (AND, OR, NOT, EOR etc) to compare and modify
> variables at a binary/bit level (see the "AND" operator here
> http://www.rtrussell.co.uk/products/bbcbasic/manual for an example)
>
> I've had a quick trawl through the PHP manual but can't see any indication
> that there are any built in PHP functions or operators that provide this
> sort of feature although it's possible that I'm not looking under the
> correct names.
>
> Before I go down the route of writing my own functions to provide these
> features can anyone point me in the direction of any buit in PHP functions
> that would do the job or failing that any user written functions.
>
> Regards
>
> -maniax-
>
>
|
|
|
|
|