Machine.shift.left????

  • Thread starter Thread starter Stephane Belzile
  • Start date Start date
S

Stephane Belzile

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?
 
Stephane Belzile said:
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.
 
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.)...
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top