CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: Date Entered: 11/4/2009 2:01:11 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 0 Views: 4 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
"ankurr" <>
NewsGroup User
Converting .bas files from VB 6.0 to VB.NET Project11/4/2009 2:01:11 PM

0

I have my project in which i have many .bas files and now i want to convert the project into VB.NET. The vbp files are directly converted by Visual Studio 2005 but .bas files are not being converted. Could u please suggest.

"integrasol" <>
NewsGroup User
Re: Converting .bas files from VB 6.0 to VB.NET Project11/4/2009 2:29:17 PM

0

It's been a while since I last worked on a VB6 project, but in general the code in the .bas files should be moved to Modules or class files in VB .NET. Mind you, you will need to do a fair bit of conversion when doing so. 


Thanks and HTH

Carsten

Please mark this post as Answer if it is of help to you. :-)
"atconway" <>
NewsGroup User
Re: Converting .bas files from VB 6.0 to VB.NET Project11/4/2009 7:55:00 PM

0

.bas files in VB6 were 'Modules' and you can have modules if you need in .NET as well.  A module is basically a Public Class with methods marked as 'Shared'.  What this does is allow your code to call the methods in the module without having to make an instantiation of the class.

I would reccomend creating a class as opposed to a module with the following declaration:

Public Class MyClass

   Public Shared Function SayHello() As String
      Return "Hello!"
   End Function

End Class

You can use a module, but to get in the mindset of moving twoards more OOP and .NET methodologies, I would use a class.  I believe the module still exists for old VB6 developers as a 'comfort for conversion' and to help feel good in developing in .NET.  The code above is equivilent to accessing code in a module and could be accessed like in the sample code below:

Dim MyString As String = String.Empty
MyString = MyClass.SayHello()


As mentioned before, there is no real great conversion path from VB6 to .NET, so some of the code regardless of the container used (class or module) is going to have to be manually updated to reflect the .NET equivilent.

Hope this helps! Smile


Thank you,   >[Blog]<

"The best thing about a boolean is even if you are wrong, you are only off by a bit." :D
-anonymous

3 Items, 1 Pages 1 |< << Go >> >|




   
  Privacy | Contact Us
All Times Are GMT