By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,558 Members | 1,699 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,558 IT Pros & Developers. It's quick & easy.

Convert C# bitwise operators to VB - How?

P: n/a
Hello,

I found some code that I could use in my application on the web, but it is
written in C#, and I would like to convert it to VB. And I am having
problems with one section. Is there anyone that could tell me how to
convert these two things?

1)

[Flags, Serializable]
public enum CardType
{
MasterCard = 0x0001,
VISA = 0x0002,
Amex = 0x0004,
DinersClub = 0x0008,
enRoute = 0x0010,
Discover = 0x0020,
JCB = 0x0040,
Unknown = 0x0080,
All = CardType.Amex | CardType.DinersClub | CardType.Discover |
CardType.Discover |
CardType.enRoute | CardType.JCB | CardType.MasterCard | CardType.VISA
}
I understand how to do the ENUM, but I don't understand what the values are?
They seem like some kind of bit settings and I don't know how to do that.

2.)

if (_cardTypes & CardType.Amex)!=0)

where _cardTypes I believe contains some bitwise combination of the
CardTypes from above.....

Thanks for any help!

Jim
Nov 20 '05 #1
Share this Question
Share on Google+
37 Replies


P: n/a
Hi James,

1:

<Flags(), Serializable()> _
Public Enum CardType
MasterCard = &H1
VISA = &H2
Amex = &H4
DinersClub = &H8
enRoute = &H10
Discover = &H20
JCB = &H40
Unknown = &H80
All = MasterCard Or VISA Or Amex Or DinersClub Or enRoute Or Discover Or
JCB
End Enum

2:

If (_cardTypes And CardType.Amex) = CardType.Amex Then
' Amex is present
End If

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Maybe it's a game called 'Punish the User'"
"James Radke" <jr*****@wi.rr.com> wrote in message
news:ub**************@TK2MSFTNGP11.phx.gbl...
: Hello,
:
: I found some code that I could use in my application on the web, but it is
: written in C#, and I would like to convert it to VB. And I am having
: problems with one section. Is there anyone that could tell me how to
: convert these two things?
:
: 1)
:
: [Flags, Serializable]
: public enum CardType
: {
: MasterCard = 0x0001,
: VISA = 0x0002,
: Amex = 0x0004,
: DinersClub = 0x0008,
: enRoute = 0x0010,
: Discover = 0x0020,
: JCB = 0x0040,
: Unknown = 0x0080,
: All = CardType.Amex | CardType.DinersClub | CardType.Discover |
: CardType.Discover |
: CardType.enRoute | CardType.JCB | CardType.MasterCard | CardType.VISA
: }
:
:
: I understand how to do the ENUM, but I don't understand what the values
are?
: They seem like some kind of bit settings and I don't know how to do that.
:
: 2.)
:
: if (_cardTypes & CardType.Amex)!=0)
:
: where _cardTypes I believe contains some bitwise combination of the
: CardTypes from above.....
:
: Thanks for any help!
:
: Jim
:
:
Nov 20 '05 #2

P: n/a
Hello,

"James Radke" <jr*****@wi.rr.com> schrieb:
1)

[Flags, Serializable]
public enum CardType
{
MasterCard = 0x0001,
VISA = 0x0002,
Amex = 0x0004,
DinersClub = 0x0008,
enRoute = 0x0010,
Discover = 0x0020,
JCB = 0x0040,
Unknown = 0x0080,
All = CardType.Amex | CardType.DinersClub | CardType.Discover |
CardType.Discover |
CardType.enRoute | CardType.JCB | CardType.MasterCard | CardType.VISA
}

I understand how to do the ENUM, but I don't understand
what the values are?
They are in hexadezimal format. Use '&H1' for '0x0001', '&H2' for '0x0002'
and so on.
2.)

if (_cardTypes & CardType.Amex)!=0)

where _cardTypes I believe contains some bitwise combination
of the CardTypes from above.....


Use 'If (m_CardTypes And CardType.Amex) <> 0 Then' instead.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3

P: n/a
Tom,

Hmmm... So the All = in #1 below would use the 'Or' versus the 'Xor'? Does
a standard Or make ALL a unique ENUM? Or is that doing something slightly
different in VB, than in the C#?

I will try it! Thanks for the assist.......

Jim
"Tom Spink" <th**********@ntlworld.com> wrote in message
news:uW**************@TK2MSFTNGP09.phx.gbl...
Hi James,

1:

<Flags(), Serializable()> _
Public Enum CardType
MasterCard = &H1
VISA = &H2
Amex = &H4
DinersClub = &H8
enRoute = &H10
Discover = &H20
JCB = &H40
Unknown = &H80
All = MasterCard Or VISA Or Amex Or DinersClub Or enRoute Or Discover Or JCB
End Enum

2:

If (_cardTypes And CardType.Amex) = CardType.Amex Then
' Amex is present
End If

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Maybe it's a game called 'Punish the User'"
"James Radke" <jr*****@wi.rr.com> wrote in message
news:ub**************@TK2MSFTNGP11.phx.gbl...
: Hello,
:
: I found some code that I could use in my application on the web, but it is : written in C#, and I would like to convert it to VB. And I am having
: problems with one section. Is there anyone that could tell me how to
: convert these two things?
:
: 1)
:
: [Flags, Serializable]
: public enum CardType
: {
: MasterCard = 0x0001,
: VISA = 0x0002,
: Amex = 0x0004,
: DinersClub = 0x0008,
: enRoute = 0x0010,
: Discover = 0x0020,
: JCB = 0x0040,
: Unknown = 0x0080,
: All = CardType.Amex | CardType.DinersClub | CardType.Discover |
: CardType.Discover |
: CardType.enRoute | CardType.JCB | CardType.MasterCard | CardType.VISA
: }
:
:
: I understand how to do the ENUM, but I don't understand what the values
are?
: They seem like some kind of bit settings and I don't know how to do that. :
: 2.)
:
: if (_cardTypes & CardType.Amex)!=0)
:
: where _cardTypes I believe contains some bitwise combination of the
: CardTypes from above.....
:
: Thanks for any help!
:
: Jim
:
:

Nov 20 '05 #4

P: n/a
Hi James,

VB's AND is a bitwise And and OR is a bitwise Or. They are the same as
their C# counterparts.

If you come across && in some C# code, it is the same as VB's AndThen.
Similarly C#'s || is the same as VB's OrElse.

Regards,
Fergus
MVP [Windows Start button, Shutdown dialogue]
Nov 20 '05 #5

P: n/a
Hello,

"Fergus Cooney" <fi******@tesco.net> schrieb:
If you come across && in some C# code, it is the same as
VB's AndThen.


'AndThen'? Typo or am I missing something?

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #6

P: n/a
Cor
Herfried,
Yes I too find these operators not nice Herfried,
In Dutch there is a proverbial: That is grist for his mill.
:-))
Cor
Nov 20 '05 #7

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
Yes I too find these operators not nice Herfried,
In Dutch there is a proverbial: That is grist for his mill.


'AndAlso' and 'OrElse' -- IMO very nice. I would have liked 'And' and 'Or'
as logical operators and 'BitAnd' and 'BitOr' as bitwise operators, but they
changed that in the Beta.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #8

P: n/a
Cor
Hi Herfried,
When the names where "BitAnd" and "BitOr" I would never argue about it.
Cor
Nov 20 '05 #9

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
When the names where "BitAnd" and "BitOr" I would
never argue about it.


You vote for 'Bit'x operators too?

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #10

P: n/a
Cor
Hi Herfried,
Of course, first of all, which VB programmer uses those really often.

We always agree that the natural language prefers, I seldom say "en ook" do
you say often "und auch" ?

That renaming bitwise operators had been a good sollution. And fits to the
theorie of natural language. Bitwise is not a part of the natural language
and for that you can create a new word.

Cor
Nov 20 '05 #11

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
Of course, first of all, which VB programmer uses those really
often.
The bitwise operators or the logical operators?
We always agree that the natural language prefers, I
seldom say "en ook" do you say often "und auch" ?
In German, "und" has the meaning of "und auch".
That renaming bitwise operators had been a good sollution.
And fits to the theorie of natural language. Bitwise is not
a part of the natural language and for that you can create
a new word.


That's exactly what I think.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #12

P: n/a
Everyone who replied,

Thanks for the assistance! After a little trial and error, everything works
great now!

Jim
"Peter Huang [MSFT]" <v-******@online.microsoft.com> wrote in message
news:O9**************@cpmsftngxa06.phx.gbl...
Hi James,
Hmmm... So the All = in #1 below would use the 'Or' versus the 'Xor'? Yes.
Does a standard Or make ALL a unique ENUM?

Yes.
The value of ALL will be &H7F in #1
Or is that doing something slightly
different in VB, than in the C#?

I think they are same in the bitwise operation.

You may check the link belwo for more information.

Used to perform a logical disjunction on two Boolean expressions, or
bitwise disjunction on two numeric values..

http://msdn.microsoft.com/library/de...us/vblr7/html/ vaopror.asp

Binary | operators are predefined for the integral types and bool. For
integral types, | computes the bitwise OR of its operands. For bool
operands, | computes the logical OR of its operands; that is, the result is false if and only if both its operands are false.
http://msdn.microsoft.com/library/de...us/csref/html/ vclrfBarOperator.asp

Dis this answer the questions?

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
Reply-To: "James Radke" <jr*****@wi.rr.com>
From: "James Radke" <jr*****@wi.rr.com>
References: <ub**************@TK2MSFTNGP11.phx.gbl>

<uW**************@TK2MSFTNGP09.phx.gbl>
Subject: Re: Convert C# bitwise operators to VB - How?
Date: Thu, 18 Sep 2003 17:02:47 -0500
Lines: 98
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eT**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: cpe-24-167-241-101.wi.rr.com 24.167.241.101
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:139201
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Tom,

Hmmm... So the All = in #1 below would use the 'Or' versus the 'Xor'? Does
a standard Or make ALL a unique ENUM? Or is that doing something slightly
different in VB, than in the C#?

I will try it! Thanks for the assist.......

Jim
"Tom Spink" <th**********@ntlworld.com> wrote in message
news:uW**************@TK2MSFTNGP09.phx.gbl...
Hi James,

1:

<Flags(), Serializable()> _
Public Enum CardType
MasterCard = &H1
VISA = &H2
Amex = &H4
DinersClub = &H8
enRoute = &H10
Discover = &H20
JCB = &H40
Unknown = &H80
All = MasterCard Or VISA Or Amex Or DinersClub Or enRoute Or Discover
Or
JCB
End Enum

2:

If (_cardTypes And CardType.Amex) = CardType.Amex Then
' Amex is present
End If

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Maybe it's a game called 'Punish the User'"
"James Radke" <jr*****@wi.rr.com> wrote in message
news:ub**************@TK2MSFTNGP11.phx.gbl...
: Hello,
:
: I found some code that I could use in my application on the web, but
itis
: written in C#, and I would like to convert it to VB. And I am having
: problems with one section. Is there anyone that could tell me how to
: convert these two things?
:
: 1)
:
: [Flags, Serializable]
: public enum CardType
: {
: MasterCard = 0x0001,
: VISA = 0x0002,
: Amex = 0x0004,
: DinersClub = 0x0008,
: enRoute = 0x0010,
: Discover = 0x0020,
: JCB = 0x0040,
: Unknown = 0x0080,
: All = CardType.Amex | CardType.DinersClub | CardType.Discover |
: CardType.Discover |
: CardType.enRoute | CardType.JCB | CardType.MasterCard |

CardType.VISA : }
:
:
: I understand how to do the ENUM, but I don't understand what the

values are?
: They seem like some kind of bit settings and I don't know how to do

that.
:
: 2.)
:
: if (_cardTypes & CardType.Amex)!=0)
:
: where _cardTypes I believe contains some bitwise combination of the
: CardTypes from above.....
:
: Thanks for any help!
:
: Jim
:
:


Nov 20 '05 #13

P: n/a
Hi Herfried, Cor,

'AndThen' is how I think of 'AndAlso', which is somewhat awkward English
as far as my usage of it goes. Like "und auch", the also doesn't add anything
unless you're emphasising - "... and another thing...."

I would prefer BitAnd and BitOr to emphasis the bitwise nature of the
operation (and unsigned values to use it on) but changing the semantics of And
and Or would break a lot of code until the programmers writing/upgrading it
had a firm realisation of this radical change.

Ah, well,

Regards,
Fergus
Nov 20 '05 #14

P: n/a
Cor
Hi Fergus,
Some weeks ago I was arguing about that in the newsgroup and told that in
Dutch (translated)
"en ook" is unusual and only used to give an extra dimension to "and". But
it is in normal Dutch awkward.

Some regulars from England and the US said that it was normal used English
but I did doubt it, because in using key words, Dutch is in many ways quiet
similar to English. But they said: "no it is well used English!"

Herfried said too that it was normal in the German language, that I can
absolute not oversee because in the German language are a lot of words quiet
similar with Dutch but it is grammatical totally different. The grammatical
seems to be from the bible from Luther, what was in the language from the
people from the mountain like Herfried.

And now you come with this sentence.
'AndThen' is how I think of 'AndAlso', which is somewhat awkward English as far as my usage of it goes. Like "und auch", the also doesn't add anything unless you're emphasising - "... and another thing...."
My first characters I did type were "Fergus I love you".
:-))
I would prefer BitAnd and BitOr to emphasis the bitwise nature of the
operation (and unsigned values to use it on) but changing the semantics of And and Or would break a lot of code until the programmers writing/upgrading it had a firm realisation of this radical change.

Make sense but I think that the most VB programmers avoid using bitwise
programming. I think 95% does not know they exist and 98% not how it works.
(Only my opinion).

Gives me a good feeling that I was not arguing* with only stupid arguments.
Cor
* do I nice use this word now or again wrong?
Nov 20 '05 #15

P: n/a
Cor
Hi Fergus,
Some weeks ago I was arguing about that in the newsgroup and told that in
Dutch (translated)
"en ook" is unusual and only used to give an extra dimension to "and". But
it is in normal Dutch awkward.

Some regulars from England and the US said that it was normal used English
but I did doubt it, because in using key words, Dutch is in many ways quiet
similar to English. But they said: "no it is well used English!"

Herfried said too that it was normal in the German language, that I can
absolute not oversee because in the German language are a lot of words quiet
similar with Dutch but it is grammatical totally different. The grammatical
seems to be from the bible from Luther, what was in the language from the
people from the mountain like Herfried.

And now you come with this sentence.
'AndThen' is how I think of 'AndAlso', which is somewhat awkward English as far as my usage of it goes. Like "und auch", the also doesn't add anything unless you're emphasising - "... and another thing...."
My first characters I did type were "Fergus I love you".
:-))
I would prefer BitAnd and BitOr to emphasis the bitwise nature of the
operation (and unsigned values to use it on) but changing the semantics of And and Or would break a lot of code until the programmers writing/upgrading it had a firm realisation of this radical change.

Make sense but I think that the most VB programmers avoid using bitwise
programming. I think 95% does not know they exist and 98% not how it works.
(Only my opinion).

Gives me a good feeling that I was not arguing* with only stupid arguments.
Cor
* do I nice use this word now or again wrong?
Nov 20 '05 #16

P: n/a
An example of 'AndThen' in everyday english would be:

If you subscribe to this newsgroup and then you phrase a question politely
then someone might answer it.

An example of 'AndAlso' in everyfday english would be:

If you have a PC and (you) also have Visual Studio .NET then you tou might
like to aprticipate in this newsgroup.

--
Stephany Young
MVP (Cooking, Cleaning, Laundry, Gardening, Decryption of Husband-Speak and
Teenager-Speak)
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader21.wxs.nl...
Hi Fergus,
Some weeks ago I was arguing about that in the newsgroup and told that in
Dutch (translated)
"en ook" is unusual and only used to give an extra dimension to "and". But
it is in normal Dutch awkward.

Some regulars from England and the US said that it was normal used English
but I did doubt it, because in using key words, Dutch is in many ways quiet similar to English. But they said: "no it is well used English!"

Herfried said too that it was normal in the German language, that I can
absolute not oversee because in the German language are a lot of words quiet similar with Dutch but it is grammatical totally different. The grammatical seems to be from the bible from Luther, what was in the language from the
people from the mountain like Herfried.

And now you come with this sentence.
'AndThen' is how I think of 'AndAlso', which is somewhat awkward English
as far as my usage of it goes. Like "und auch", the also doesn't add

anything
unless you're emphasising - "... and another thing...."


My first characters I did type were "Fergus I love you".
:-))
I would prefer BitAnd and BitOr to emphasis the bitwise nature of the operation (and unsigned values to use it on) but changing the semantics

of And
and Or would break a lot of code until the programmers writing/upgrading it
had a firm realisation of this radical change.

Make sense but I think that the most VB programmers avoid using bitwise
programming. I think 95% does not know they exist and 98% not how it

works. (Only my opinion).

Gives me a good feeling that I was not arguing* with only stupid arguments.

Cor
* do I nice use this word now or again wrong?

Nov 20 '05 #17

P: n/a
An example of 'AndThen' in everyday english would be:

If you subscribe to this newsgroup and then you phrase a question politely
then someone might answer it.

An example of 'AndAlso' in everyfday english would be:

If you have a PC and (you) also have Visual Studio .NET then you tou might
like to aprticipate in this newsgroup.

--
Stephany Young
MVP (Cooking, Cleaning, Laundry, Gardening, Decryption of Husband-Speak and
Teenager-Speak)
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader21.wxs.nl...
Hi Fergus,
Some weeks ago I was arguing about that in the newsgroup and told that in
Dutch (translated)
"en ook" is unusual and only used to give an extra dimension to "and". But
it is in normal Dutch awkward.

Some regulars from England and the US said that it was normal used English
but I did doubt it, because in using key words, Dutch is in many ways quiet similar to English. But they said: "no it is well used English!"

Herfried said too that it was normal in the German language, that I can
absolute not oversee because in the German language are a lot of words quiet similar with Dutch but it is grammatical totally different. The grammatical seems to be from the bible from Luther, what was in the language from the
people from the mountain like Herfried.

And now you come with this sentence.
'AndThen' is how I think of 'AndAlso', which is somewhat awkward English
as far as my usage of it goes. Like "und auch", the also doesn't add

anything
unless you're emphasising - "... and another thing...."


My first characters I did type were "Fergus I love you".
:-))
I would prefer BitAnd and BitOr to emphasis the bitwise nature of the operation (and unsigned values to use it on) but changing the semantics

of And
and Or would break a lot of code until the programmers writing/upgrading it
had a firm realisation of this radical change.

Make sense but I think that the most VB programmers avoid using bitwise
programming. I think 95% does not know they exist and 98% not how it

works. (Only my opinion).

Gives me a good feeling that I was not arguing* with only stupid arguments.

Cor
* do I nice use this word now or again wrong?

Nov 20 '05 #18

P: n/a
Cor
Stephany, (checked twice now)
An example of 'AndThen' in everyday English would be:

If you subscribe to this newsgroup and then you phrase a question politely
then someone might answer it.
An example of 'AndAlso' in everyday English would be:
If you have a PC and (you) also have Visual Studio .NET then you tou might like to participate in this newsgroup.

That is the same as in Dutch (with other words for "and" and "also" and
"then", but phonetical are "and" and "then" almost the same as in English).

When you look at a thread I tried to start about a serious discussion about
AndAlso the answer were totaly oposite.

Thanks,

(Did you make those typing errors express to tickle me or was it an accident
:-)) ?)

Cor
Nov 20 '05 #19

P: n/a
Cor
Stephany, (checked twice now)
An example of 'AndThen' in everyday English would be:

If you subscribe to this newsgroup and then you phrase a question politely
then someone might answer it.
An example of 'AndAlso' in everyday English would be:
If you have a PC and (you) also have Visual Studio .NET then you tou might like to participate in this newsgroup.

That is the same as in Dutch (with other words for "and" and "also" and
"then", but phonetical are "and" and "then" almost the same as in English).

When you look at a thread I tried to start about a serious discussion about
AndAlso the answer were totaly oposite.

Thanks,

(Did you make those typing errors express to tickle me or was it an accident
:-)) ?)

Cor
Nov 20 '05 #20

P: n/a
I think I must have :)

--
Stephany Young
MVP (Cooking, Cleaning, Laundry, Gardening, Decryption of Husband-Speak and
Teenager-Speak)

"Cor" <no*@non.com> wrote in message
news:3f***********************@reader21.wxs.nl...
Stephany, (checked twice now)
An example of 'AndThen' in everyday English would be:

If you subscribe to this newsgroup and then you phrase a question politely then someone might answer it.
An example of 'AndAlso' in everyday English would be:

If you have a PC and (you) also have Visual Studio .NET then you tou

might like to participate in this newsgroup.
That is the same as in Dutch (with other words for "and" and "also" and
"then", but phonetical are "and" and "then" almost the same as in

English).
When you look at a thread I tried to start about a serious discussion about AndAlso the answer were totaly oposite.

Thanks,

(Did you make those typing errors express to tickle me or was it an accident :-)) ?)

Cor

Nov 20 '05 #21

P: n/a
I think I must have :)

--
Stephany Young
MVP (Cooking, Cleaning, Laundry, Gardening, Decryption of Husband-Speak and
Teenager-Speak)

"Cor" <no*@non.com> wrote in message
news:3f***********************@reader21.wxs.nl...
Stephany, (checked twice now)
An example of 'AndThen' in everyday English would be:

If you subscribe to this newsgroup and then you phrase a question politely then someone might answer it.
An example of 'AndAlso' in everyday English would be:

If you have a PC and (you) also have Visual Studio .NET then you tou

might like to participate in this newsgroup.
That is the same as in Dutch (with other words for "and" and "also" and
"then", but phonetical are "and" and "then" almost the same as in

English).
When you look at a thread I tried to start about a serious discussion about AndAlso the answer were totaly oposite.

Thanks,

(Did you make those typing errors express to tickle me or was it an accident :-)) ?)

Cor

Nov 20 '05 #22

P: n/a
Hello,

"Fergus Cooney" <fi******@tesco.net> schrieb:
I would prefer BitAnd and BitOr to emphasis the bitwise
nature of the operation (and unsigned values to use it on)
but changing the semantics of And and Or would break a
lot of code until the programmers writing/upgrading it
had a firm realisation of this radical change.


I think that was the main reason why they changed it back. They didn't want
to confuse the VB developers.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #23

P: n/a
Hello,

"Fergus Cooney" <fi******@tesco.net> schrieb:
I would prefer BitAnd and BitOr to emphasis the bitwise
nature of the operation (and unsigned values to use it on)
but changing the semantics of And and Or would break a
lot of code until the programmers writing/upgrading it
had a firm realisation of this radical change.


I think that was the main reason why they changed it back. They didn't want
to confuse the VB developers.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #24

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
That is the same as in Dutch (with other words for
"and" and "also" and "then", but phonetical are "and"
and "then" almost the same as in English).


In some German dialects, it's pronounced similar to the English version.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #25

P: n/a
Hello,

"Stephany Young" <st******@sysoft.co.nz> schrieb:
An example of 'AndThen' in everyday english would be:

If you subscribe to this newsgroup and then you phrase
a question politely then someone might answer it.
In German we would say:

Wenn du die Newsgroup abonnierst _und dann_
höflich eine Frage stellst, dann wirst du vielleicht eine
Antwort bekommen.
An example of 'AndAlso' in everyfday english would be:

If you have a PC and (you) also have Visual Studio
.NET then you tou might like to aprticipate in this
newsgroup.
In German:

Wenn du einen PC _und auch_ Visual Studio .NET hast,
dann...
Stephany Young
MVP (Cooking, Cleaning, Laundry, Gardening, Decryption
of Husband-Speak and Teenager-Speak)


:-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #26

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
Make sense but I think that the most VB programmers avoid
using bitwise programming.


Remember that in VB6 only bitwise 'And', 'Or', etc. operators existed.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #27

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
That is the same as in Dutch (with other words for
"and" and "also" and "then", but phonetical are "and"
and "then" almost the same as in English).


In some German dialects, it's pronounced similar to the English version.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #28

P: n/a
Hello,

"Stephany Young" <st******@sysoft.co.nz> schrieb:
An example of 'AndThen' in everyday english would be:

If you subscribe to this newsgroup and then you phrase
a question politely then someone might answer it.
In German we would say:

Wenn du die Newsgroup abonnierst _und dann_
höflich eine Frage stellst, dann wirst du vielleicht eine
Antwort bekommen.
An example of 'AndAlso' in everyfday english would be:

If you have a PC and (you) also have Visual Studio
.NET then you tou might like to aprticipate in this
newsgroup.
In German:

Wenn du einen PC _und auch_ Visual Studio .NET hast,
dann...
Stephany Young
MVP (Cooking, Cleaning, Laundry, Gardening, Decryption
of Husband-Speak and Teenager-Speak)


:-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #29

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
Make sense but I think that the most VB programmers avoid
using bitwise programming.


Remember that in VB6 only bitwise 'And', 'Or', etc. operators existed.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #30

P: n/a
Cor
> > Make sense but I think that the most VB programmers avoid
using bitwise programming.

But who knows that, I never had paid any attention to it.
Now you tell this I know why I did found the behaviour of And and Or always
so strange in VB6.
Nov 20 '05 #31

P: n/a
Cor
> > Make sense but I think that the most VB programmers avoid
using bitwise programming.

But who knows that, I never had paid any attention to it.
Now you tell this I know why I did found the behaviour of And and Or always
so strange in VB6.
Nov 20 '05 #32

P: n/a
Hi Cor,

:-))

I'm sure that you argued* your point well in that discussion against your
countrymen and also** against the English speakers.

Even when I first started using BASIC I was into bits. But then I
discovered C and moved camp.

Regards,
Fergus

* Yep, correct usage.

** Ok but still a bit awkward. I would normally use 'as well as'
Nov 20 '05 #33

P: n/a
Hi Stephany,

|| Stephany Young
|| MVP (Cooking, Cleaning, Laundry, Gardening,
|| Decryption of Husband-Speak and Teenager-Speak)

LOL

Regards,
Fergus
Nov 20 '05 #34

P: n/a
Hi Cor,

:-))

I'm sure that you argued* your point well in that discussion against your
countrymen and also** against the English speakers.

Even when I first started using BASIC I was into bits. But then I
discovered C and moved camp.

Regards,
Fergus

* Yep, correct usage.

** Ok but still a bit awkward. I would normally use 'as well as'
Nov 20 '05 #35

P: n/a
Hi Stephany,

|| Stephany Young
|| MVP (Cooking, Cleaning, Laundry, Gardening,
|| Decryption of Husband-Speak and Teenager-Speak)

LOL

Regards,
Fergus
Nov 20 '05 #36

P: n/a
Cor
Hi Fergus,

You don't believe it, for that "as well as" I was long-time searching in my
mind. I did not like it, that I always was using "too" as well as "also" in
my sentences.

Cor
Nov 20 '05 #37

P: n/a
Cor
Hi Fergus,

You don't believe it, for that "as well as" I was long-time searching in my
mind. I did not like it, that I always was using "too" as well as "also" in
my sentences.

Cor
Nov 20 '05 #38

This discussion thread is closed

Replies have been disabled for this discussion.