How to Complile *.bas file in VB.NET
-
Hi All, I have vb code in the form of temp.bas file. I want to use that in my VB.NET workspace. Can any one tell me how to do this? Thanks in Advance JN
Does it contain VB.NET code ? If not, you won't be able to use it.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hi All, I have vb code in the form of temp.bas file. I want to use that in my VB.NET workspace. Can any one tell me how to do this? Thanks in Advance JN
VB.net does not support bas files. The replacement is the .Module file. In a new VB.Net project, just add a new Module and paste your code into it. However, it will probably not compile. VB.Net is rather different from VB. So, check the Errors tab, it will tell you what needs changing. In the long run it would be best to rewrite your code as a class library, as VB.Net is an object orientated language, and module files are just an excuse for those who can't be bothered to upgrade their coding skills. .Net has been around for five years now!
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850)
-
VB.net does not support bas files. The replacement is the .Module file. In a new VB.Net project, just add a new Module and paste your code into it. However, it will probably not compile. VB.Net is rather different from VB. So, check the Errors tab, it will tell you what needs changing. In the long run it would be best to rewrite your code as a class library, as VB.Net is an object orientated language, and module files are just an excuse for those who can't be bothered to upgrade their coding skills. .Net has been around for five years now!
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850)
Thank you very much for response. The *.bas file contains VB code. When I copy *.bas file content to my VB.NET workspace *.vb file and compile it shows many error.I am not able to resolve those error. Is there any otherway we can compile *.bas file and use it VB.NET. I dont have previous version of VB, can you please tell me how to compile *.bas file to generate exe and run it has standalone utility? Thanks in Advance JN
-
Thank you very much for response. The *.bas file contains VB code. When I copy *.bas file content to my VB.NET workspace *.vb file and compile it shows many error.I am not able to resolve those error. Is there any otherway we can compile *.bas file and use it VB.NET. I dont have previous version of VB, can you please tell me how to compile *.bas file to generate exe and run it has standalone utility? Thanks in Advance JN
Nalla Jaipal wrote:
I dont have previous version of VB, can you please tell me how to compile *.bas file to generate exe and run it has standalone utility?
Without the VB6 compiler, you're stuck. You don't have anything that will compile that code. VB.NET will NOT compile a VB6 file without translation. Most of the old VB language is intact, but there are glaring differences in some of the basics. For instance, the Long type in VB6 is now an Integer. You simply have no choice but to rewrite the code in VB.NET if you want to use it in your app.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Thank you very much for response. The *.bas file contains VB code. When I copy *.bas file content to my VB.NET workspace *.vb file and compile it shows many error.I am not able to resolve those error. Is there any otherway we can compile *.bas file and use it VB.NET. I dont have previous version of VB, can you please tell me how to compile *.bas file to generate exe and run it has standalone utility? Thanks in Advance JN
Nalla Jaipal wrote:
Is there any otherway we can compile *.bas file and use it VB.NET.
Yes, you can get a copy of VB6 on ebay, and you can build a COM dll which your .NET app consumes. This is a really bad idea, you should rewrite the code. If you don't have VB6, where did the code come from ?
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Nalla Jaipal wrote:
Is there any otherway we can compile *.bas file and use it VB.NET.
Yes, you can get a copy of VB6 on ebay, and you can build a COM dll which your .NET app consumes. This is a really bad idea, you should rewrite the code. If you don't have VB6, where did the code come from ?
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )