Home All Groups Group Topic Archive Search About
Author
8 Nov 2006 2:56 PM
Fred
I have a String of bits -- "101011". I want to extract each bit in the
string as a char and then use each extracted char in multiplication.

The extraction part is easy (I think).

How can I convert each char to an int so that I can use it for
multiplication?

Thanks.

Author
8 Nov 2006 3:07 PM
rowe_newsgroups
cint(..)

Thanks,

Seth Rowe


Fred wrote:
Show quoteHide quote
> I have a String of bits -- "101011". I want to extract each bit in the
> string as a char and then use each extracted char in multiplication.
>
> The extraction part is easy (I think).
>
> How can I convert each char to an int so that I can use it for
> multiplication?
>
> Thanks.
Author
9 Nov 2006 5:20 AM
Cor Ligthert [MVP]
Hi Fred,

The first one is

Dim fred As Integer = Val("101011"(0))

I hope this helps,

Cor

Show quoteHide quote
"Fred" <eomerm***@yahoo.com> schreef in bericht
news:1162997818.300527.198790@m7g2000cwm.googlegroups.com...

>I have a String of bits -- "101011". I want to extract each bit in the
> string as a char and then use each extracted char in multiplication.
>
> The extraction part is easy (I think).
>
> How can I convert each char to an int so that I can use it for
> multiplication?
>
> Thanks.
>
Author
11 Nov 2006 1:08 AM
Fred
val() worked without any problem. Cint() did not care for a char being
passed to it.
Thank you for your responses!
Cor Ligthert [MVP] wrote:
Show quoteHide quote
> Hi Fred,
>
> The first one is
>
> Dim fred As Integer = Val("101011"(0))
>
> I hope this helps,
>
> Cor
>
> "Fred" <eomerm***@yahoo.com> schreef in bericht
> news:1162997818.300527.198790@m7g2000cwm.googlegroups.com...
>
> >I have a String of bits -- "101011". I want to extract each bit in the
> > string as a char and then use each extracted char in multiplication.
> >
> > The extraction part is easy (I think).
> >
> > How can I convert each char to an int so that I can use it for
> > multiplication?
> >
> > Thanks.
> >