473,236 Members | 1,697 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,236 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 2126
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mike Hodkin | last post by:
As a beginning student of C++, books reference "bitwise operators" and give brief examples, but I have not read a good explanation of what they are used for. One reference mentioned that they are...
24
by: Alex Vinokur | last post by:
Consider the following statement: n+i, where i = 1 or 0. Is there more fast method for computing n+i than direct computing that sum? -- Alex Vinokur email: alex DOT vinokur AT gmail DOT...
2
by: Joe Gonzalez | last post by:
Is it possible to perform bitwise operations in selects in DB2 8.1? In postgres I can say something like SELECT ... FROM <sometable> WHERE RecFlags && 0x08 <> 0 to get a bitwise and operation. I...
6
by: jas_lx | last post by:
The basic understanding of what bitwise operators (& ^ | >> << ) comes fairly simple, as long as one has a fundamental understanding of bits, bytes and binary. Having done some Win32...
8
by: Paul E Collins | last post by:
Suppose I have a few Keys objects: Keys k1 = Keys.V; // V Keys k2 = Keys.Control | Keys.V; // Ctrl+V Keys k3 = Keys.Shift | Keys.J; // Shift+J I need to determine which of these include the...
32
by: John Davis | last post by:
One interesting observation I found is VB6 or VB.NET overloads = opeartor. i.e. = operator has 2 meanings. Case 1: relational operator. In other languages, usually use == instead. If a = b Then...
29
by: Carl Banks | last post by:
Anyone with me here? (I know the deadline for P3 PEPs has passed; this is just talk.) Not many people are bit-fiddling these days. One of the main uses of bit fields is flags, but that's not...
2
by: snorble | last post by:
I started creating a simple "bits" class, intended to act like a array of bits. This was my initial idea, basically just overriding the string representation to display the bitmask (so far): ...
10
by: Rob Wilkerson | last post by:
I'm attempting to do some work around existing code that uses bitwise operations to manage flags passed into a function and I'm quite frankly unequipped to do so. I've never done much with bitwise...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.