Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Sub Main()
Just to make sure:

I have a VB Project that does not contain any Forms or
controls.  So I start my Project in Sub Main in the Module.

Do I need to do anything to terminate this Project
since 'Unload Me' will not work in the Module?  Is it OK
just to let the code run until it gets to the End Sub in
Sub Main (and that will be the end of the story)?

Makes sense, but I want to make sure that's what should
happen.

---- Andy

Report this thread to moderator Post Follow-up to this message
Old Post
Andy
10-28-04 08:55 PM


Re: Sub Main()
"Andy" <Andrzej7@hotmail.com> wrote in message
news:1b5e01c4bd04$36ff8210$a601280a@phx.gbl...
>
> Just to make sure:
>
> I have a VB Project that does not contain any Forms or
> controls.  So I start my Project in Sub Main in the Module.
>
> Do I need to do anything to terminate this Project
> since 'Unload Me' will not work in the Module?  Is it OK
> just to let the code run until it gets to the End Sub in
> Sub Main (and that will be the end of the story)?

Absolutely.  If you ever find a situation where it isnt' terminating, then
you have larger problems that you need to fix.  I've never seen that in the
situation that you described, though.  If you don't have any forms or
controls, it's hard to create a scenario where objects won't let themselves
be closed.

matt



Report this thread to moderator Post Follow-up to this message
Old Post
YYZ
10-28-04 08:55 PM


Re: Sub Main()
"Andy" <Andrzej7@hotmail.com> wrote in message
news:1b5e01c4bd04$36ff8210$a601280a@phx.gbl
> Just to make sure:
>
> I have a VB Project that does not contain any Forms or
> controls.  So I start my Project in Sub Main in the Module.
>
> Do I need to do anything to terminate this Project
> since 'Unload Me' will not work in the Module?  Is it OK
> just to let the code run until it gets to the End Sub in
> Sub Main (and that will be the end of the story)?
>
> Makes sense, but I want to make sure that's what should
> happen.

That's what should happen.

--
Reply to the group so all can participate
VB.Net... just say "No"


Report this thread to moderator Post Follow-up to this message
Old Post
Bob Butler
10-28-04 08:55 PM


Re: Sub Main()
On Thu, 28 Oct 2004 08:38:47 -0700, "Andy" <Andrzej7@hotmail.com>
wrote:

>
>Just to make sure:
>
>I have a VB Project that does not contain any Forms or
>controls.  So I start my Project in Sub Main in the Module.
>
>Do I need to do anything to terminate this Project
>since 'Unload Me' will not work in the Module?  Is it OK
>just to let the code run until it gets to the End Sub in
>Sub Main (and that will be the end of the story)?
>
>Makes sense, but I want to make sure that's what should
>happen.

Funny enough, it works out exactly as that.

Your main shoudl call up a module function from which all other
functions tree out.

When it is finished, the control is returned to the calling sub (the
Main) a nd whan it hits the End Sub, it finishes and unloads itself
from memory.


 ****************************************
******************************
Richard Jalbert      Programmer-Analyst          Richmann@sympatico.ca

Dogs have owners, cats have staff.

http://www3.sympatico.ca/richmann/
 ****************************************
******************************

Report this thread to moderator Post Follow-up to this message
Old Post
Richard Jalbert
10-28-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:13 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.