473,386 Members | 1,830 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,386 software developers and data experts.

Machine.shift.left????

Using a CSharp to vb.net converter, I've been stuck on a single line
of code for hours

Original C# code

uint result = dcb.Flags & (mask << whichFlag);
return (int) (result >> whichFlag);

Vb.Net code
Return CInt(Machine.Shift.Right(result, whichFlag))

What is this machine.Shift thing? I understand what it is meant to do
but what namespace do I have to include to make this thing work?
Nov 21 '05 #1
3 2563

"Stephane Belzile" <st*************@cgi.com> schrieb:
Using a CSharp to vb.net converter, I've been stuck on a single line
of code for hours

Original C# code

uint result = dcb.Flags & (mask << whichFlag);
return (int) (result >> whichFlag);

Vb.Net code
Return CInt(Machine.Shift.Right(result, whichFlag))

What is this machine.Shift thing? I understand what it is meant to do
but what namespace do I have to include to make this thing work


There is no such thing. But if you are using VB.NET 2003, you can use '<<'
there too.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #2
> There is no such thing. But if you are using VB.NET 2003, you can use
'<<'
there too.

but it doesn't work for unsigned variables (API etc.)...

--
Pozdrav,
Josip Medved, MCSD
http://www.jmedved.com

Nov 21 '05 #3
Stephane,
As Hefried suggests, I would use << or >> in VS.NET 2003.

As you may know unsigned integers are not supported in VS.NET 2003, VS.NET
2005 (aka Whidbey due out later in 2005) will add support for unsigned
integers. For details on VS.NET 2005 see
http://lab.msdn.microsoft.com/vs2005/.
Where did you get the following sample?
Return CInt(Machine.Shift.Right(result, whichFlag))
What is this machine.Shift thing? I understand what it is meant to do
but what namespace do I have to include to make this thing work?
To the best of my knowledge (and a quick search of MSDN) it is not part of
the .NET framework?

Is it a private assembly required by the C# to VB.NET converter you used?

Hope this helps
Jay

"Stephane Belzile" <st*************@cgi.com> wrote in message
news:60**************************@posting.google.c om... Using a CSharp to vb.net converter, I've been stuck on a single line
of code for hours

Original C# code

uint result = dcb.Flags & (mask << whichFlag);
return (int) (result >> whichFlag);

Vb.Net code
Return CInt(Machine.Shift.Right(result, whichFlag))

What is this machine.Shift thing? I understand what it is meant to do
but what namespace do I have to include to make this thing work?

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Glen Able | last post by:
Just to get my head straight on this... Firstly, am I right in thinking that right-shifting a signed integer has an undefined result (i.e. could be implemented as a logical or arithmetic shift)?...
388
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
4
by: Kevin | last post by:
I was looking through some source code and noticed the used of the C# << operator. Why is this being used here and under what circumstances is an left-shift operator useful. internal enum...
11
by: Kenneth Lantrip | last post by:
Anyone got any ideas as to how this process could be improved for speed? this is what I have... Dim j, q As Integer Dim x(16), y(16) As Byte x.CopyTo(y, 0) ' shift left circular 24 bits
9
by: deepak | last post by:
If i'm shifting an integer 'n' times where n > sizeof(int), It's giving the same value as that of n-sizeof(n). Why is it behaving like this. I studied that the bit 'll be replaced by '0'. ...
1
by: jonathanmcdougall | last post by:
I am developing a calendar on which dates can be clicked and selected. A calendar is a table in which each day is a cell. Each cell has a unique id. By left-clicking on a date, it gets selected...
4
by: sandhya | last post by:
Hello Folks, i hava a problem in coding of circular left shift of 25 bits in my program...how do i perform it, and how do i use unsigned in VB. My program (IDEA algorithm implementation in VB) ...
56
by: Christian Christmann | last post by:
Hi, in the header of my class I've a constant static const int a = ( 1 << 32 ) - 1; When compiling the code, g++ issues the warning "warning: left shift count >= width of type" Why? And...
3
by: Cindy | last post by:
I am struggling over a simple way to shift multi bytes for certain bits. Hope someone can help. For example, I open a memory space for 10 bytes: unsigned char *pData = new unsigned char; then...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.