Math Question
-
it's the percent symbol:
int n = 10 % 3;
n == 1
Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page
-
it's the percent symbol:
int n = 10 % 3;
n == 1
Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page
-
For future ref try this: VB.NET and C# Comparison[^]
Kevin
-
Also, this site is pretty good Convert VB to C# and vice-versa[^]
Kevin
-
Also, this site is pretty good Convert VB to C# and vice-versa[^]
Kevin
Here is a .NET 2.0 online converter (built on the SharpDevelop code like yours, but using much more recent code): http://codeconverter.sharpdevelop.net/Convert.aspx[^]
-
Here is a .NET 2.0 online converter (built on the SharpDevelop code like yours, but using much more recent code): http://codeconverter.sharpdevelop.net/Convert.aspx[^]
Daniel Grunwald wrote:
Daniel Grunwald
Strangely, I remember trying something on that once and finding that it didn't work, so went back to the developerfusion hosted one. This would have been about a year ago.
Kevin
-
Daniel Grunwald wrote:
Daniel Grunwald
Strangely, I remember trying something on that once and finding that it didn't work, so went back to the developerfusion hosted one. This would have been about a year ago.
Kevin
Send me a mail if something doesn't work. Note that our converter currently only accepts code that would be valid syntax as a file (whole compilation unit) - this means you can must post whole class definitions, code snippets won't be recognized correctly.
-
Send me a mail if something doesn't work. Note that our converter currently only accepts code that would be valid syntax as a file (whole compilation unit) - this means you can must post whole class definitions, code snippets won't be recognized correctly.
Daniel Grunwald wrote:
Note that our converter currently only accepts code that would be valid syntax as a file (whole compilation unit)
Ah, that would be it then. In that case it would be more useful if it was like the developerfusion version.
Kevin
-
Daniel Grunwald wrote:
Note that our converter currently only accepts code that would be valid syntax as a file (whole compilation unit)
Ah, that would be it then. In that case it would be more useful if it was like the developerfusion version.
Kevin
OK, I'll try to implement that. But from a converter, I expect that it gets most things right. Here is a test case that our converter does right, but many others don't:
using System;
public class MyClass
{
string abc;public string Abc { get { return abc; } }
// This is a test method static void M<T>(params T\[\] args) where T : IDisposable { Console.WriteLine("Hello!"); }
}
Difficulties: 1) realizing MyClass is not a valid identifier in VB 2) renaming abc to not conflict with Abc, since VB is case insensitive 3) not dropping comments 4) supporting generics - .NET 2.0 isn't new anymore in 2007 5) not messing up the ParamsArray parameter 6) noticing M() is a private method because the C# default is private. In VB, it must read "Private Shared Sub" because the default visibility in VB is Public. All of these at not uncommon in C# code (e.g. "Stop" might be a C# method name, but is VB keyword). The Telerik converter is quite good (gets all except #2 and #6 right), our converter gets all right (because I created the example based on our unit tests), all others I tested failed miserably. For SharpDevelop/NRefactory 3.0, I'm looking into making the converter aware of the code semantics - so that VB->C# can get a(1) converted to a[1] or a(1) depending on what a is. And make VB->C# fix up inconsistencies in the casing.
Last modified: 31mins after originally posted -- added difficulty 6
-
OK, I'll try to implement that. But from a converter, I expect that it gets most things right. Here is a test case that our converter does right, but many others don't:
using System;
public class MyClass
{
string abc;public string Abc { get { return abc; } }
// This is a test method static void M<T>(params T\[\] args) where T : IDisposable { Console.WriteLine("Hello!"); }
}
Difficulties: 1) realizing MyClass is not a valid identifier in VB 2) renaming abc to not conflict with Abc, since VB is case insensitive 3) not dropping comments 4) supporting generics - .NET 2.0 isn't new anymore in 2007 5) not messing up the ParamsArray parameter 6) noticing M() is a private method because the C# default is private. In VB, it must read "Private Shared Sub" because the default visibility in VB is Public. All of these at not uncommon in C# code (e.g. "Stop" might be a C# method name, but is VB keyword). The Telerik converter is quite good (gets all except #2 and #6 right), our converter gets all right (because I created the example based on our unit tests), all others I tested failed miserably. For SharpDevelop/NRefactory 3.0, I'm looking into making the converter aware of the code semantics - so that VB->C# can get a(1) converted to a[1] or a(1) depending on what a is. And make VB->C# fix up inconsistencies in the casing.
Last modified: 31mins after originally posted -- added difficulty 6
In my scenario I was: 1. Still using .Net 1.1. 2. Mostly doing C# to VB snippet conversions. In this scenario, the developerfusion site was adequate enough. I had been doing C# for a few years before having to work on a VB project. It would be nice if you could get yours to do snippets though because often we see articles in one language, where we just want to convert a few lines or a method. Often there isn't a full compilation unit presented.
Kevin
-
In my scenario I was: 1. Still using .Net 1.1. 2. Mostly doing C# to VB snippet conversions. In this scenario, the developerfusion site was adequate enough. I had been doing C# for a few years before having to work on a VB project. It would be nice if you could get yours to do snippets though because often we see articles in one language, where we just want to convert a few lines or a method. Often there isn't a full compilation unit presented.
Kevin
A snippet converter has now been added: http://codeconverter.sharpdevelop.net/[^]