473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Beginner question... Cannot name the subject

Hi newsgroup,

I am trying to migrate from VB6 to VB.Net.
I am having serious understanding problems about why VB.Net 2005 Express
doesn't do what I want.
I have a C# code, and I was trying to convert it to VB.

The first thing that made (and still makes) me crazy is that seemingly I
cannot tell VB to use "sub main" as the start procedure. If anybody
knows how then that would make me really happy.

The next issue it that this code doesn't work in a module:

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports IrrlichtNETCP
Imports IrrlichtNETCP.Inheritable

Module Module1
Namespace Tutorial01
Class Tutorial01
Private Shared Sub Main(ByVal args As String())
'//Foo
End Sub
End Class
End Namespace

End Module

---------------------------------
Imports are okay, but then it tells me that "Namespace-Commands can only
be stated in Namespace or Filespace" (not perfect translation of error
message, but I hope it does...).

Thanks a million for your help.
Tim
Aug 4 '07 #1
6 1149
Namespace Tutorial01

Module Module1

Aug 4 '07 #2
to load from the Sub Main, try making it Public, not private then go to the
project properties and change it there. that should work.
--
-iwdu15
Aug 4 '07 #3
On Aug 3, 6:53 pm, Tim Zottberg <tim.zottb...@email.comwrote:
Hi newsgroup,

I am trying to migrate from VB6 to VB.Net.
I am having serious understanding problems about why VB.Net 2005 Express
doesn't do what I want.
I have a C# code, and I was trying to convert it to VB.

The first thing that made (and still makes) me crazy is that seemingly I
cannot tell VB to use "sub main" as the start procedure. If anybody
knows how then that would make me really happy.

The next issue it that this code doesn't work in a module:

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports IrrlichtNETCP
Imports IrrlichtNETCP.Inheritable

Module Module1
Namespace Tutorial01
Class Tutorial01
Private Shared Sub Main(ByVal args As String())
'//Foo
End Sub
End Class
End Namespace

End Module

---------------------------------
Imports are okay, but then it tells me that "Namespace-Commands can only
be stated in Namespace or Filespace" (not perfect translation of error
message, but I hope it does...).

Thanks a million for your help.
Tim
Hi,
you can download book for beginners from this site :
http://expressdotnet.freehostia.com
or directly http://expressdotnet.freehostia.com/book.html
Tutorial on the site : http://expressdotnet.freehostia.com/compiler.html
Have fun !
Omar Abid

Aug 4 '07 #4
Thanks to all!
Tm
Aug 4 '07 #5
Tom
To change to sub main, you need to go into project properties and
uncheck the "Windows Framework" box. It will then change to startup
object and you can choose it in the startup dropdown.
Try this instead:
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports IrrlichtNETCP
Imports IrrlichtNETCP.Inheritable

Namespace Tutorial01
Class Tutorial01
Private Shared Sub Main(ByVal args As String())
'//Foo
End Sub
End Class
End Namespace

Modules can contain shared vars, etc. Just declaring them as Public var
as String will leave them globally accessible.


Imports System
Imports System.Collections.Generic
Imports System.Text
Imports IrrlichtNETCP
Imports IrrlichtNETCP.Inheritable

Module Module1
Namespace Tutorial01
Class Tutorial01
Private Shared Sub Main(ByVal args As String())
'//Foo
End Sub
End Class
End Namespace

End Module

Tim Zottberg wrote:
Thanks to all!
Tm
Aug 4 '07 #6
"Omar Abid" <om***********@gmail.comschrieb:
you can download book for beginners from this site :
http://expressdotnet.freehostia.com
Well, I wonder if providing the e-book for download is a copyright
violation... I'd be more careful.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 4 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: Mike Malter | last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I can call that method again later using reflection. I am...
14
by: japin0 | last post by:
Hi, I am a absolute beginner in ASP ..I do have a bit of exposure to .VBS and other scripting languages. I need your guidance, where do I start? I had been to MS website Quick start guide but it...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
5
by: Jacky Luk | last post by:
import java.awt.Graphics; public class printtest extends java.applet.Applet { public void init() { } public void paint (Graphics g) {
1
by: Robert J. Bonn | last post by:
I'm trying to set up a contact list in MS Access 97. I've looked through a reference book and the program's help screens, but the light bulb isn't quite coming on for me. If one of you could take...
4
by: Hitchkas | last post by:
I have a very beginner and fundamental question regarding porting and running C# programs in Linux. As a background I am a total idiot when it comes to Linux but somehow managed to install Ubuntu...
2
by: roanhn | last post by:
Hello. I've to to write a master's thesis. Currently I deal with php, mysql, ajax. Fate decreed that I've to choose one of this subjects: 1.gdi+ library in .net technology 2.ado.net technology...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.