471,071 Members | 967 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

Do I use 'or' for bitwise operations where in c# I use | ?

Do I use 'or' for bitwise operations where in c# I use | ?
Nov 21 '05 #1
10 2022
Yes

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
"Emilio" <[void]> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Do I use 'or' for bitwise operations where in c# I use | ?

Nov 21 '05 #2
"Emilio" <[void]> schrieb:
Do I use 'or' for bitwise operations where in c# I use | ?


'Or' <-> '|' (bitwise)
'OrElse' <-> '||' (logical)

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #3
In addition to OHM

'Or' can as well be logical however not in the way as C# that one is
'OrElse'

Cor
Nov 21 '05 #4

O.k. , so bitwise is definitly 'or' , but logical does not have
to be 'OrElse' it can be 'or' as well,
if xy=5 or abc=8 then
msgbox "hello"
end if
'Or' <-> '|' (bitwise)
'OrElse' <-> '||' (logical)


Nov 21 '05 #5
"Emilio" <[void]> schrieb:
O.k. , so bitwise is definitly 'or' , but logical does not have
to be 'OrElse' it can be 'or' as well,
if xy=5 or abc=8 then
msgbox "hello"
end if


Well, in this particular case, 'True' is or'ed (bitwise) with 'True', which
results in 'True'. Behind the scenes a bitwise operation is performed.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #6
I thought that the "OrElse" construct just prevented the short circuit so
the next token would be processed:
A or B orelse c = something.
Thus c is not left undefined.
Aor B else c = something would leave c undefined if A or B is false.
What did I miss?
(Note that I am still coding another rather obscure language so I'm not
attempting to get the syntax correct as I learn the logic)
BobJ
"Cor Ligthert" <no************@planet.nl> wrote in message
news:OV**************@TK2MSFTNGP10.phx.gbl...
In addition to OHM

'Or' can as well be logical however not in the way as C# that one is
'OrElse'

Cor

Nov 21 '05 #7
OrElse is a logical operator. It first evaluates the left side of the
comparison statement, and if True does not bother evaluating the right hand
statement because it is futile to do so.

AndAlso does the same thing for an And function, if the left side is True it
wil evaluate the right side, otherwise the final result is false.

HTH

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
"BobJ" <bo*@rjsolyn.com> wrote in message
news:40******************@newsread2.news.atl.earth link.net...
I thought that the "OrElse" construct just prevented the short circuit so
the next token would be processed:
A or B orelse c = something.
Thus c is not left undefined.
Aor B else c = something would leave c undefined if A or B is false.
What did I miss?
(Note that I am still coding another rather obscure language so I'm not
attempting to get the syntax correct as I learn the logic)
BobJ
"Cor Ligthert" <no************@planet.nl> wrote in message
news:OV**************@TK2MSFTNGP10.phx.gbl...
In addition to OHM

'Or' can as well be logical however not in the way as C# that one is
'OrElse'

Cor


Nov 21 '05 #8
Note that the return type is still considered to be boolean (I believe the language definition states that the bitwise operators are defined only for integral
types) - in this case it doesn't matter much what happens behind the scenes - if both operands are boolean you can think about it as a simple boolean
operator, if any of the arguments is numeric, then it will be a bitwise operator.
Also note that Or does not cause evaluation of the second argument not to occur when the first argument is true, unlike OrElse.
--------------------
From: "Herfried K. Wagner [MVP]" <hi***************@gmx.at>
References: <#u**************@TK2MSFTNGP09.phx.gbl> <#o**************@TK2MSFTNGP09.phx.gbl> <OLYWZ37qEHA.2796 @tk2msftngp13.phx.gbl>Subject: Re: Do I use 'or' for bitwise operations where in c# I use | ?
Date: Wed, 6 Oct 2004 18:05:48 +0200
Lines: 14
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <eZ*************@TK2MSFTNGP15.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: v208-105.vps.tuwien.ac.at 128.131.208.105
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP15.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:233545
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

"Emilio" <[void]> schrieb:
O.k. , so bitwise is definitly 'or' , but logical does not have
to be 'OrElse' it can be 'or' as well,
if xy=5 or abc=8 then
msgbox "hello"
end if
Well, in this particular case, 'True' is or'ed (bitwise) with 'True', which
results in 'True'. Behind the scenes a bitwise operation is performed.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Sorry I don't take feature request for WinRes: it belongs to the .NET Framework SDK. I'm a consumer of WinRes, just like you...
--------------------From: Thomas Adams <th************@gmail.com>
Newsgroups: microsoft.public.dotnet.internationalization
Subject: RE: How to launch WinRes in full screen mode by another program?
Date: 29 Sep 2004 19:31:46 GMT
Organization: DFN.CIS Senior Customer
Lines: 17
Message-ID: <Xn**********************************@127.0.0.1>
References: <2q************@uni-berlin.de> <r3**************@cpmsftngxa06.phx.gbl>
X-Trace: news.uni-berlin.de cGk7xWd2iWxkO9HVbF7isQODBzMeOPRUidb0ZHc/H3nGY=
User-Agent: Xnews/06.08.25
X-Converter: MorVer Version 1.0.305
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFT NGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu- berlin.de!uni-berlin.de!not-for-mailXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.internationalization:947
X-Tomcat-NG: microsoft.public.dotnet.internationalization

Hi

Your assumption is correct. I did not want to call out its long name
since I didn't know if that could be regarded as breach of NDA. :)

Thanks for the explanation. Do you take feature requests for WinRes?
I'd like to see a "remember last size and location" some day...

~T.

xu*@online.microsoft.com (Xu Yang[MSFT]) wrote:
--

[Formerly appended fullquote was nuked by morver,
the versatile morphing server.]

I'm afraid that LocStudio (when you say LS, I assume you are using LocStudio) does not have the option, and WinRes does not remember its size and
location when it was shut down.
If you are trying to call it in your own application, you can always use ProcessWindowStyle.Maximized when you start the process.

--------------------From: Thomas Adams <me*@privacy.net>
Newsgroups: microsoft.public.dotnet.internationalization
Subject: How to launch WinRes in full screen mode by another program?
Date: 11 Sep 2004 21:26:17 GMT
Organization: DFN.CIS Senior Customer
Lines: 9
Message-ID: <2q************@uni-berlin.de>
X-Trace: news.uni-berlin.de 9sj2ViefNkwlw4tmA89WfA6mie8fmrCfbXqlIJqRehUb0=
User-Agent: Xnews/06.08.25
X-Face: #Rk@TOQ|^!ZG|&z6lA@-CY>/xB[Ei1mG*&S.+A5z;Ng?3OxX[#DVZw!"o!c`S|p:(zsX-EkdZZ(IVnFRTX%!:Sv^L&Gk~s]vJ@Z~%Rm@G]fr*r2P}u5 *&k/-_2+&Qowj6hiJ1b$^JQf:uy9456HIdKq*B`NC##kyO,>7"Ztnav +=71b*"E+DIme;{i&)ii{#6e?i8P,1Xpc[q0}i:Tm];B1X-Converter: MorVer Version 1.0.305
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu- berlin.de!uni-berlin.de!not-for-mailXref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.internationalization:902
X-Tomcat-NG: microsoft.public.dotnet.internationalization

Hi

Let's imagine you're using a translation environment (LS) that's
launching WinRes every now and then. Is it possible to open WinRes in
full screen mode in this case? It's quite annoying that it doesn't
remember if I switch it to full screen mode the next time it is invoked.

thanks,
Thomas


Nov 21 '05 #9
> Also note that Or does not cause evaluation of the second
argument not to occur when the first argument is true, unlike OrElse.


'OrElse' will provide short-circuiting, which means that 'expression2' in
'expression1 OrElse expression2' will not be evaluated if 'expression1' is
already 'True'. 'Or' will evaluate both, 'expression1' and 'expression2',
independent from the result of 'expression1''s evaluation.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #10
Thanks for the translation :)

--------------------
From: "Herfried K. Wagner [MVP]" <hi***************@gmx.at>
References: <#u**************@TK2MSFTNGP09.phx.gbl> <#o**************@TK2MSFTNGP09.phx.gbl> <OLYWZ37qEHA.2796 @tk2msftngp13.phx.gbl> <eZ*************@TK2MSFTNGP15.phx.gbl> <8n**************@cpmsftngxa06.phx.gbl>Subject: Re: Do I use 'or' for bitwise operations where in c# I use | ?
Date: Sat, 9 Oct 2004 14:29:18 +0200
Lines: 13
Organization: MVPs.org
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
x-mimeole: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <OM**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: n643p008.adsl.highway.telekom.at 62.47.24.72
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:234185
X-Tomcat-NG: microsoft.public.dotnet.languages.vb
Also note that Or does not cause evaluation of the second
argument not to occur when the first argument is true, unlike OrElse.
'OrElse' will provide short-circuiting, which means that 'expression2' in
'expression1 OrElse expression2' will not be evaluated if 'expression1' is
already 'True'. 'Or' will evaluate both, 'expression1' and 'expression2',
independent from the result of 'expression1''s evaluation.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Sorry I don't take feature request for WinRes: it belongs to the .NET Framework SDK. I'm a consumer of WinRes, just like you...
--------------------From: Thomas Adams <th************@gmail.com>
Newsgroups: microsoft.public.dotnet.internationalization
Subject: RE: How to launch WinRes in full screen mode by another program?
Date: 29 Sep 2004 19:31:46 GMT
Organization: DFN.CIS Senior Customer
Lines: 17
Message-ID: <Xn**********************************@127.0.0.1>
References: <2q************@uni-berlin.de> <r3**************@cpmsftngxa06.phx.gbl>
X-Trace: news.uni-berlin.de cGk7xWd2iWxkO9HVbF7isQODBzMeOPRUidb0ZHc/H3nGY=
User-Agent: Xnews/06.08.25
X-Converter: MorVer Version 1.0.305
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFT NGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu- berlin.de!uni-berlin.de!not-for-mailXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.internationalization:947
X-Tomcat-NG: microsoft.public.dotnet.internationalization

Hi

Your assumption is correct. I did not want to call out its long name
since I didn't know if that could be regarded as breach of NDA. :)

Thanks for the explanation. Do you take feature requests for WinRes?
I'd like to see a "remember last size and location" some day...

~T.

xu*@online.microsoft.com (Xu Yang[MSFT]) wrote:
--

[Formerly appended fullquote was nuked by morver,
the versatile morphing server.]

I'm afraid that LocStudio (when you say LS, I assume you are using LocStudio) does not have the option, and WinRes does not remember its size and
location when it was shut down.
If you are trying to call it in your own application, you can always use ProcessWindowStyle.Maximized when you start the process.

--------------------From: Thomas Adams <me*@privacy.net>
Newsgroups: microsoft.public.dotnet.internationalization
Subject: How to launch WinRes in full screen mode by another program?
Date: 11 Sep 2004 21:26:17 GMT
Organization: DFN.CIS Senior Customer
Lines: 9
Message-ID: <2q************@uni-berlin.de>
X-Trace: news.uni-berlin.de 9sj2ViefNkwlw4tmA89WfA6mie8fmrCfbXqlIJqRehUb0=
User-Agent: Xnews/06.08.25
X-Face: #Rk@TOQ|^!ZG|&z6lA@-CY>/xB[Ei1mG*&S.+A5z;Ng?3OxX[#DVZw!"o!c`S|p:(zsX-EkdZZ(IVnFRTX%!:Sv^L&Gk~s]vJ@Z~%Rm@G]fr*r2P}u5 *&k/-_2+&Qowj6hiJ1b$^JQf:uy9456HIdKq*B`NC##kyO,>7"Ztnav +=71b*"E+DIme;{i&)ii{#6e?i8P,1Xpc[q0}i:Tm];B1X-Converter: MorVer Version 1.0.305
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu- berlin.de!uni-berlin.de!not-for-mailXref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.internationalization:902
X-Tomcat-NG: microsoft.public.dotnet.internationalization

Hi

Let's imagine you're using a translation environment (LS) that's
launching WinRes every now and then. Is it possible to open WinRes in
full screen mode in this case? It's quite annoying that it doesn't
remember if I switch it to full screen mode the next time it is invoked.

thanks,
Thomas


Nov 21 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Mike Hodkin | last post: by
24 posts views Thread by Alex Vinokur | last post: by
2 posts views Thread by Joe Gonzalez | last post: by
6 posts views Thread by jas_lx | last post: by
8 posts views Thread by Paul E Collins | last post: by
32 posts views Thread by John Davis | last post: by
29 posts views Thread by Carl Banks | last post: by
2 posts views Thread by snorble | last post: by
10 posts views Thread by Rob Wilkerson | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.