Issues with Converting C#.NET code into VB.Net code

Issues with Converting C#.NET code into VB.Net code

Anonymous
Not applicable
459 Views
4 Replies
Message 1 of 5

Issues with Converting C#.NET code into VB.Net code

Anonymous
Not applicable


Feel free to add on for other issues with translating C# code as well as approaches and solutions so as many solutions as possible appear in one place.
-------------------------------------------------------------------------------------------------------------------------
My translator (.Net Reflector 5.0) was unable to convert the C# "this" statement into something VB.Net understood.

For example the C# statement:
- this.ids = new ObjectIdCollection();

Got translated into:
- Dim CS$1$0000 As ObjectIdCollection

Any ideas how to properly translate this to VB.Net.... this is kind of like Abbot and Kostello's "Who's on First"....

This came from code Tony Tanzillo linked in the "Working With Nested Blocks" thread on Nov 12 and repeated below:
http://www.caddzone.com/BlockExplodeHelper.cs

0 Likes
460 Views
4 Replies
Replies (4)
Message 2 of 5

jerrywinters
Participant
Participant
That looks like a bad translation.

It looks like the variable 'ids' is declared as a variable in the Class. The keyword 'this' indicates it is a member of the current Class. A literal translation into VB.NET would look like:

{code}
Me.ids = new ObjectIDCollection()
{code}

Hope this helps.

Jerry
0 Likes
Message 3 of 5

Anonymous
Not applicable
Hi

try out this. this will help u.

http://www.developerfusion.com/tools/convert/csharp-to-vb/

With Regards
divya
0 Likes
Message 4 of 5

Anonymous
Not applicable
Thanks Divya and Jerry,

The online code converter converted the C# code to exactly what Jerry noted.

Does Reflector not support the 3.5 .NET framework? (See Attached Image). Or is there some configuration thing I missed?...

I thought Reflector is the converter of choice? If not what is? Tony, what are you using? Edited by: HEnnulat on Nov 19, 2009 10:15 AM
0 Likes
Message 5 of 5

Anonymous
Not applicable
Reflector doesn't always do a true translation of code.

I would probably try one of the online translators that are
available, searching the newsgroup should turn up a few
links to them if no one else can refer you to one.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6291194@discussion.autodesk.com...
Feel free to add on for other issues with translating C# code as well as
approaches and solutions so as many solutions as possible appear in one
place. -------------------------------------------------------------------------------------------------------------------------
My translator (.Net Reflector 5.0) was unable to convert the C# "this"
statement into something VB.Net understood. For example the C# statement: -
this.ids = new ObjectIdCollection(); Got translated into: - Dim CS$1$0000 As
ObjectIdCollection Any ideas how to properly translate this to VB.Net....
this is kind of like Abbot and Kostello's "Who's on First".... This came
from code Tony Tanzillo linked in the "Working With Nested Blocks" thread on
Nov 12 and repeated below: http://www.caddzone.com/BlockExplodeHelper.cs
0 Likes