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

Machine???

I have some code from C# that I have converted to vb.net. I used a
converter for a lot of it. One piece is giving problems
Machine.Shift.Right

it says that it is not declared.

where is the machine class, or how else do I do this .

C# code:

public string MaskToLogicalPaths(int aMask)

{

int lMask = aMask;

int lValue = 0;

StringBuilder lReturn = new StringBuilder(128);

try

{

lReturn = new StringBuilder(128);

if(aMask>0)

{

for (;lMask!=0;lMask>>=1)

{

if ((lMask & 1)!=0)

{

lReturn.Append((char)(65+lValue));

lReturn.Append(":,");

}

lValue ++;

}

lReturn.Remove(lReturn.Length-1,1);

}

return lReturn.ToString();

}

finally

{

lReturn = null;

}

}

vb code:

Public Function MaskToLogicalPaths(ByVal aMask As Integer) As String

Dim lMask As Integer = aMask

Dim lValue As Integer = 0

Dim lReturn As New StringBuilder(128)

Try

lReturn = New StringBuilder(128)

If aMask > 0 Then

While lMask <> 0

If (lMask And 1) <> 0 Then

lReturn.Append(Microsoft.VisualBasic.ChrW(65 + lValue))

lReturn.Append(":,")

End If

lValue += 1

lMask = Machine.Shift.Right(lMask, 1)

End While

lReturn.Remove(lReturn.Length - 1, 1)

End If

Return lReturn.ToString()

Finally

lReturn = Nothing

End Try

End Function
Nov 20 '05 #1
1 1127
Bit shifting is available with the << and >> operators in VB.NET. Look these
up in the help

Regards

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Lespaul36" <le*******@none.net> wrote in message
news:Ol**************@TK2MSFTNGP10.phx.gbl...
I have some code from C# that I have converted to vb.net. I used a
converter for a lot of it. One piece is giving problems
Machine.Shift.Right

it says that it is not declared.

where is the machine class, or how else do I do this .

C# code:

public string MaskToLogicalPaths(int aMask)

{

int lMask = aMask;

int lValue = 0;

StringBuilder lReturn = new StringBuilder(128);

try

{

lReturn = new StringBuilder(128);

if(aMask>0)

{

for (;lMask!=0;lMask>>=1)

{

if ((lMask & 1)!=0)

{

lReturn.Append((char)(65+lValue));

lReturn.Append(":,");

}

lValue ++;

}

lReturn.Remove(lReturn.Length-1,1);

}

return lReturn.ToString();

}

finally

{

lReturn = null;

}

}

vb code:

Public Function MaskToLogicalPaths(ByVal aMask As Integer) As String

Dim lMask As Integer = aMask

Dim lValue As Integer = 0

Dim lReturn As New StringBuilder(128)

Try

lReturn = New StringBuilder(128)

If aMask > 0 Then

While lMask <> 0

If (lMask And 1) <> 0 Then

lReturn.Append(Microsoft.VisualBasic.ChrW(65 + lValue))

lReturn.Append(":,")

End If

lValue += 1

lMask = Machine.Shift.Right(lMask, 1)

End While

lReturn.Remove(lReturn.Length - 1, 1)

End If

Return lReturn.ToString()

Finally

lReturn = Nothing

End Try

End Function

Nov 20 '05 #2

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

Similar topics

13
by: Adrian Parker | last post by:
I wrote a VB program on my Windows XP machine. It does multi table queries, you can add/delete and edit records, it all worked very beautifully. I was very careful to validate data, and on my...
9
by: Marina Anufreichik | last post by:
Hi, After deploymnet web application on web server I can access page on local machine and login fine but when I'm trying to access web site from remote machine I can see login page, but when I'm...
12
by: Oliver Knoll | last post by:
Ok, I've searched this group for Big/Little endian issues, don't kill me, I know endianess issues have been discussed a 1000 times. But my question is a bit different: I've seen the follwing...
3
by: | last post by:
This question references to KB articles: http://support.microsoft.com/default.aspx?scid=kb;EN-US;315158 http://support.microsoft.com/default.aspx?scid=kb;EN-US;317012 I'm running Advanced Server...
6
by: Mikey_Doc | last post by:
Hi We are running cms 2002, Framework 1.0 with Visual studio 2002. We have just upgraded to Framework 1.1 and visual studio 2003. All of our database connection strings are stored within the...
27
by: Javier Martinez | last post by:
Hi I have asp application in a machine with a virtual directory referring a shared directory in another machine When I try to load any aspx page of my portal I get the following error: ...
0
by: sameer | last post by:
Environment: OS of sql server 2000 server: windows 2003 standard server , .NEt framework 1.1 , sql server does not have any service pack, machine has the latest Windows service pack. Personal...
11
by: TARUN | last post by:
Hello All I need to ask about the configuration file in .NET, There are Two config File 1. Web Config 2. Machine config I understand the the usage of Web config , but not able to understand...
4
by: Shawnk | last post by:
This post is intended to verify that true value semantics DO NOT EXIST for the Enum class (relative to boolean operations). If this is true then (thus and therefore) you can not design state...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a app that uses several membership/role providers. I can list these Providers with the code: Dim rootWebConfig1 As Configuration rootWebConfig1 =...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.