|
Posted by Rob Wilkerson on 12/02/07 03:47
On Dec 1, 10:15 pm, Rob Wilkerson <r.d.wilker...@gmail.com> wrote:
> On Dec 1, 9:54 pm, ZeldorBlat <zeldorb...@gmail.com> wrote:
>
> I may have to follow up on this thread, but I have to do my own due
> diligence even to know what question to ask.
Okay, I figured out what I was doing wrong and have both functions
behaving exactly the same. Almost. The difference is that when the
function is called, the constants are available to it and the bitwise
expression is passed in as just that - a bitwise expression (is it
properly called an "expression"?). The method, though, is forced to
pass the expression in as a string for evaluation within the method
itself.
So the function gets FLAG_1|FLAG_6|FLAG_4 (evaluating to 41), while
the method gets 'FLAG_1|FLAG_6|FLAG_4' (no evaluation done). In the
method, I split the string, apply the constant values and get the
correct output (1|32|8), but it's still a string. How can I evaluate
that string to get 41?
Thanks again for the help.
[Back to original message]
|