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

VB Class

P: n/a
Hy Guys.. I'm Trying to write a class (clasliga.vb), but I'M receiving this
message from compiler:

vbc: error BC30420: 'Sub Main' was not found in 'ClasLiga'

Please tell me what is wrong...

This is my code:

Public Class Ligacoes

Private sLigaAten as String
Private sLigaDest as String
Private sLigaReme as String
Private sLigaTele as String
Private sLigaAssu as String

Property LigaAten() As String
Get
Return sLigaAten
End Get
Set(ByVal sNome As String)
sLigaAten = sNome
End Set
End Property

Property LigaDest() As String
Get
Return sLigaDest
End Get
Set(ByVal sNome As String)
sLigaDest = sNome
End Set
End Property

Property LigaReme() As String
Get
Return sLigaReme
End Get
Set(ByVal sNome As String)
sLigaReme = sNome
End Set
End Property

Property LigaTele() As String
Get
Return sLigaTele
End Get
Set(ByVal sNome As String)
sLigaTele = sNome
End Set
End Property

Property LigaAssu() As String
Get
Return sLigaAssu
End Get
Set(ByVal sNome As String)
sLigaAssu = sNome
End Set
End Property

End Class
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"André Almeida Maldonado" <de***@bol.com.br> schrieb
Hy Guys.. I'm Trying to write a class (clasliga.vb), but I'M
receiving this message from compiler:

vbc: error BC30420: 'Sub Main' was not found in 'ClasLiga'

Please tell me what is wrong...

This is my code:
[Class without Sub Main]


Seems like you don't have a Sub Main....

What is the first procedure that should be executed when your application
starts? You must have a Sub Main somewhere. In the project properties, you
can specify the startup object, i.e. where your Sub Main is located. You can
also specify a Form object there because an invisible Sub Main will be
added.
--
Armin

http://learn.to/quote
http://www.plig.net/nnq/nquote.html

Nov 20 '05 #2

P: n/a
you alse seem to be missing a
Public Sub New()

hope it helps

eric
Nov 20 '05 #3

P: n/a
* "André Almeida Maldonado" <de***@bol.com.br> scripsit:
vbc: error BC30420: 'Sub Main' was not found in 'ClasLiga'


Do you want to compile a class library with "vbc.exe"? Don't forger to
specify "/target:library" in the command calling the compiler.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

P: n/a
* "EricJ" <ericRéMo**@ThiSomnipack.be> scripsit:
you alse seem to be missing a
Public Sub New()


That's not the reason for the compile error.

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

P: n/a
* hi***************@gmx.at (Herfried K. Wagner [MVP]) scripsit:
* "André Almeida Maldonado" <de***@bol.com.br> scripsit:
vbc: error BC30420: 'Sub Main' was not found in 'ClasLiga'


Do you want to compile a class library with "vbc.exe"? Don't forger to
specify "/target:library" in the command calling the compiler.


I forgot to mention: If you want to compile an executable, it needs an
entry point, the 'Sub Main'.

\\\
Public Class ...
Public Shared Sub Main()

' Add the application code here.
End Sub

Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.