dim v as oByte
v = bit1;
v.Lshift(1);
v = v Or bit2;
v.Lshift(1);
v = v Or bit3;
--- In oopic@yahoogroups.com, "design.wonk" <design.wonk@...> wrote:
>
> Wow, that was so logical. I guess that I was thinking that it had to
> be more complicated.
>
> thanks
>
>
>
> --- In oopic@yahoogroups.com, Andrew Porrett <slicerwizard@> wrote:
> >
> > v = bit1 * 4 + bit2 * 2 + bit3 ?
> >
> > At 11:42 PM 5/6/2008, design.wonk wrote:
> > >I have an array of three bits (based on an object being in range on a
> > >combination of three IR sensors). Is there a graceful way to convert
> > >this 3-bit array to a single byte value? I have written a function
> > >that returns a value of 0 to 7 based on the status of the bits in the
> > >array, but it uses a long and awkward series of If Then Else looping.
> > > I was wondering if there is a simpler way to do this with version
> 6.1.
> > >
> > >thanks
> >
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment