Home All Groups Group Topic Archive Search About

Re: Converting C to VB, question re assignment by bitwise OR

Author
21 Jun 2009 12:35 PM
Alfie [UK]
On Sun, 21 Jun 2009 12:11:14 +0100, MM <kylix***@yahoo.co.uk> wrote:

>The line in C reads:
>
>lpSync->wFlags |= IN_SYNC;
>
>How do I render this in VB? For example:
>
>lpSync.wFlags = lpSync.wFlags OR IN_SYNC
>
>?

Yup, all the compound assignment functions in C/C++ use a similar
form;

a {operator}= b
a = a {operator} b
--
Alfie [UK]
<http://www.delphia.co.uk/>
Bad command or file name! Go stand in the corner.

Author
21 Jun 2009 3:22 PM
Lorin
I must be in the wrong group.

Show quoteHide quote
"Alfie [UK]" wrote:

> On Sun, 21 Jun 2009 12:11:14 +0100, MM <kylix***@yahoo.co.uk> wrote:
>
> >The line in C reads:
> >
> >lpSync->wFlags |= IN_SYNC;
> >
> >How do I render this in VB? For example:
> >
> >lpSync.wFlags = lpSync.wFlags OR IN_SYNC
> >
> >?
>
> Yup, all the compound assignment functions in C/C++ use a similar
> form;
>
> a {operator}= b
> a = a {operator} b
> --
> Alfie [UK]
> <http://www.delphia.co.uk/>
> Bad command or file name! Go stand in the corner.
>
>
Author
21 Jun 2009 6:59 PM
Alfie [UK]
On Sun, 21 Jun 2009 08:22:01 -0700, Lorin
<Lo***@discussions.microsoft.com> wrote:

>I must be in the wrong group.

MM has already asked and received several questions/answers here about
the VB app that he is developing, and mentioned that he is converting
C source to VB for some of it, so I see no reason not to answer the
question about conversion from C to VB here.

Would seem a bit cruel to force him to a C group to ask an elementary
syntax question which most Cers would either ignore or take the mickey
out of him if he mentioned that he was converting to VB
Classic...those C guys can be cruel about our little, old VB :)
--
Alfie [UK]
<http://www.delphia.co.uk/>
Learn from the mistakes of others. You won't live long enough to make them all yourself.
Author
22 Jun 2009 8:50 PM
Jeff Johnson
"Lorin" <Lo***@discussions.microsoft.com> wrote in message
news:AAEA904B-6B09-4FF9-977D-F5CC604B82FD@microsoft.com...

>I must be in the wrong group.

Why? It was a perfectly legitimate VB question.