"Alexandre Moura" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How are you compiling this code?
In my command prompt compiler, I type in vbc Box2.vb. This should compile
Box1.vb since Box2.vb has a reference to Box1.vb. In java, thats exactly how
I compiled it, except using javac and a .java extension.
for me if I compile with "vbc box1.vb box2.vb" what I get is an error for
having two shared sub main statements.
> You may want to read up on building libraries, references, or getting VB
..Net Express.
>
> Hope that helps,
> Alex (MS VB QA)
>
> --------------------
> >NNTP-Posting-Date: Sun, 15 Aug 2004 20:54:37 -0500
> >From: "G. Seshadri" <(E-Mail Removed)>
> >Newsgroups: microsoft.public.dotnet.languages.vb
> >Subject: Class recognition
> >Date: Sun, 15 Aug 2004 21:54:38 -0400
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
> >Message-ID: <wr2dnYzq7OxAjr3cRVn-(E-Mail Removed)>
> >Lines: 37
> >NNTP-Posting-Host: 24.50.157.8
> >X-Trace:
sv3-pHUxlRIVTVtNgcxTNfCgHi8HgBZisCti8wqYmoCGo4O/HI/gSdMQOWXMn221vq+uhhVcpIk0
2iR1OPJ!
>
pyry9uPsibddwrWZizyRm4raRM9NULlmWb/sk0N+qaHHL77d8QgvExWu6rSM4XIS3YS9NJCphGCT
!4pr6ILmvEp5fRQ==
> >X-Complaints-To: (E-Mail Removed)
> >X-DMCA-Complaints-To: (E-Mail Removed)
> >X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
> >X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
> >X-Postfilter: 1.3.13
> >Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!border2.nntp.dca.giganews.com!
>
border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com
!nntp.adelphia.com!news.adelphia.com.POSTED!not-for-mail
> >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:223149
> >X-Tomcat-NG: microsoft.public.dotnet.languages.vb
> >
> >In .NET programming I noticed that if I make a file called Box1.vb with
the
> >following code:
> >
> >Imports System
> >
> >Class Box1
> > Shared Sub Main()
> > End Sub
> >
> > Function test (ByVal num As Integer) As Integer
> > Return num*2
> > End Function
> > End Class
> >
> >then I can't take advantage of it in any other file. For example, If I
made
> >another class called Box2.vb and put it in the same directory and typed
in
> >the following code, the compiler would give me an error:
> >
> >Imports System
> >
> >Class Box2
> > Shared Sub Main()
> > Dim b1 As New Box1
> > Console.WriteLine(b1.test(4))
> > End Sub
> >End Class
> >
> >What do I need to do so that Box2 recognizes the class Box1?
> >
> >P.S.
> >However, if I put the code of Box2.vb inside Box1.vb and deleted Box2.vb
> >altogether, then it would compile successfully. However, I would need to
> >call the file Box2.vb, not Box1.vb, since Box2.vb's main function is
going
> >to be executed.
> >
> >
> >
> >
>
> Thanks & Regards
> Santhosh Somayajulu
> Internet Information Services Team,
> Microsoft
>
>