.NET

Reply
Valued Contributor
HEnnulat
Posts: 51
Registered: ‎10-05-2009
Message 1 of 5 (106 Views)

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

106 Views, 4 Replies
11-18-2009 09:25 AM


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

Active Contributor
jerrywinters
Posts: 40
Registered: ‎04-25-2007
Message 2 of 5 (106 Views)

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

11-18-2009 12:54 PM in reply to: HEnnulat
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
Distinguished Contributor
divyasree
Posts: 109
Registered: ‎10-14-2007
Message 3 of 5 (106 Views)

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

11-18-2009 08:51 PM in reply to: HEnnulat
Hi

try out this. this will help u.

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

With Regards
divya
Valued Contributor
HEnnulat
Posts: 51
Registered: ‎10-05-2009
Message 4 of 5 (106 Views)

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

11-19-2009 07:58 AM in reply to: HEnnulat
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
*Tony Tanzillo
Message 5 of 5 (106 Views)

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

11-19-2009 12:58 PM in reply to: HEnnulat
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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!