PDA

View Full Version : Installscript Question '|' operator processing



mikenac
06-21-2005, 10:53 AM
I have a function that looks like this:




#define FLAG1 100
#define FLAG2 200
#define FLAG3 300

prototype foo ( STRING, NUMBER )

function foo ( szString, nFlags )
begin
......................


I want to be able to pass the flags to my function, like this:



foo ( "Foo", FLAG1|FLAG2);


What I cannot figure out is how to process these flags inside my function. I tried something like:



if ( nFlags && FLAG1 ) then
.......

This always returns true and is not what I want. It seems like I am missing something simple here, but I can't seem to figure it out.

Any clues?

Thanks.

RobertDickau
06-21-2005, 11:09 AM
The && operator is the logical-and operator; is it the & bitwise-and operator you want?

mikenac
06-21-2005, 08:02 PM
Yes! Thank you. That and some binary defines worked out well.