By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,887 Members | 1,154 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,887 IT Pros & Developers. It's quick & easy.

Module Name Change 101

P: n/a
Hi, This is something really simple.

A Console Application example in a course book, where the module file name
was renamed to Welcome1, works fine when I use the original name "module1"
for the module.
In the book they advise to change this module name to "modFirstWelcome"
simply by replacing the identifier "module1" to "modFirstWelcome". Nothing
else seems to be needed. Fine, but if I do so and go to Build>Build Solution,
an error comes up stating: : “ ‘Sub Main’ was not found in Welcome1.module1 “
The section "SumMain ... to .. End Sub is still there. So it looks like the
new name is not recognized. What is wrong and how do I do this correctly?

So the following works fine:

Module module1

Sub Main()
Console.WriteLine("Welcome to Visual Basic!")
End Sub

End Module

While this does not:

Module modFirstWelcome

Sub Main()
Console.WriteLine("Welcome to Visual Basic!")
End Sub

End Module

Thanks for your advice,
--
John
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"John Pass" <Jo******@discussions.microsoft.com> wrote in message
news:Jo******@discussions.microsoft.com:
In the book they advise to change this module name to "modFirstWelcome"
simply by replacing the identifier "module1" to "modFirstWelcome". Nothing
else seems to be needed. Fine, but if I do so and go to Build>Build Solution,
an error comes up stating: : " 'Sub Main' was not found in Welcome1.module1 "
The section "SumMain ... to .. End Sub is still there. So it looks like the
new name is not recognized. What is wrong and how do I do this correctly?


You may need to change Project -> Properties, then in the Common
Properties section highlight General and check your Startup Object.
Could that be it?

--

-shane

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.