I was playing with VB.Net yesterday using Visual Studio Express (VSE). I am trying to get a feel for the language. One thing that struck me was the fact that VB's entry point, Sub Main(), is written inside a Module, as opposed to inside a Class like in C#. At least that's how it appears in the books I'm reading. That got me thinking. Is it possible to change the entry point location from a Module to a Class, or for that matter to have Sub Main() completely outside these two constructs?
I search the internet and found out that VSE indeed allows one to changed the entry point through the project properties. So I set the entry point to Sub Main() and tried compiling the "Hello World!" project locating Sub Main() inside a Class construct. Well, that didn't work. I tried changing the name of the class to match the project name, but that didn't help. I didn't bother try putting Sub Main() completely outside a module or class figuring that would be impossible. However, while looking through various post in this forum, I got the feeling I gave up to soon. So here are my questions:
1. Can the entry point be within a Class/Form construct or completely outside any construct for that matter?
2. Can the entry point be some other Sub (e.g., Sub MyMain)
If the answer is yes to anyone of these questions, where do I set the option to make this work?
I'll take any help I can get.
Thanks!
I search the internet and found out that VSE indeed allows one to changed the entry point through the project properties. So I set the entry point to Sub Main() and tried compiling the "Hello World!" project locating Sub Main() inside a Class construct. Well, that didn't work. I tried changing the name of the class to match the project name, but that didn't help. I didn't bother try putting Sub Main() completely outside a module or class figuring that would be impossible. However, while looking through various post in this forum, I got the feeling I gave up to soon. So here are my questions:
1. Can the entry point be within a Class/Form construct or completely outside any construct for that matter?
2. Can the entry point be some other Sub (e.g., Sub MyMain)
If the answer is yes to anyone of these questions, where do I set the option to make this work?
I'll take any help I can get.
Thanks!