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

Beginner question... Cannot name the subject

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
Namespace Tutorial01

Module Module1

Aug 4 '07 #2

P: n/a
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

P: n/a
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

P: n/a
Thanks to all!
Tm
Aug 4 '07 #5

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.