You are here: Re: Help With Bitwise Operations « PHP Programming Language « IT news, forums, messages
Re: Help With Bitwise Operations

Posted by Jerry Stuckle on 12/02/07 03:57

Rob Wilkerson wrote:
> 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.

Rob,

Your method should be getting the bitwise expression, also. Just
because it's a method in a class doesn't make any difference as to
what's being called.

How about some code?


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация