0

The reason I need this is I'm porting a VB6 app and I'm getting a very small difference in the arithmetic between VB6 and C#. I just need to test a couple calculations. The one I'm most interested in is how this comes out:

Round(2.24984, 1)

If that comes out to 2.3 in VB6 I'm done, it's figured out. But if not there are a couple steps leading up to that which could also be the problem.

An online VB6 fiddle would be ideal but I can install a virtual machine if I have to.

user875234
  • 2,399
  • 7
  • 31
  • 49
  • 1
    It comes out to 2.2 in VB6. – Brian M Stafford Nov 14 '18 at 19:04
  • 1
    It comes out to 2.2 in VB.Net (2017). – R.J. Dunnill Nov 14 '18 at 19:51
  • 1
    I'm not sure I understand what question you're asking. You can certainly install VB6 if you have a copy. Are you asking about where you can buy a copy (which I think would be off-topic for Stack Overflow), or are you having some problem installing it or something? –  Nov 14 '18 at 20:05
  • @PeterCooperJr. you know how they have online C#, C++, Java, Rust, etc. etc. fiddles? I was hoping for something like that for VB6. Aside from that though I'm open to any way of installing any VB6 compiler. Of course I could go buy one off ebay and find a computer it will run on but I was looking for an easier way of doing it. – user875234 Nov 14 '18 at 20:22
  • 1
    VB6 uses banker's rounding, but that doesn't really matter with your example - it only comes into play with rounding halves up or down based on the odd/even value of the preceding digit, I believe. Since your number isn't exactly 2.25 it will round down to 2.2. – Bill Hileman Nov 14 '18 at 21:13
  • 2
    Visual Basic for Applications is 95% equivalent to VB6 so you could try a macro in Office (Word, Excel etc) if you have a copy. – MarkJ Nov 15 '18 at 12:22
  • Possible duplicate of [Alternative IDE for VB6 and VBA](https://stackoverflow.com/questions/226565/alternative-ide-for-vb6-and-vba) – StayOnTarget Nov 19 '18 at 13:14
  • Are you really asking about the rounding behavior? Or are you asking about the compiler? – StayOnTarget Nov 19 '18 at 13:15
  • I need to compile it so I can see the rounding behavior. – user875234 Nov 19 '18 at 14:44

1 Answers1

2

No, you cannot compile a VB6 project directly in Visual Studio 2017.

What you can do is open the project in Visual Studio 2008 and migrate it to VB.Net using the Visual Basic Update Wizard. (The migrated code will likely have errors you will have to fix yourself.) Once this is done, you can open the migrated project in Visual Studio 2017 (the current production release of Visual Studio).

R.J. Dunnill
  • 2,049
  • 3
  • 10
  • 21