Results 1 to 6 of 6

Thread: Is Sub Main Really Necessary?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2007
    Posts
    3

    Is Sub Main Really Necessary?

    I loaded a Program that I had partially completed in VB 4. It converted the files, only loaded 2 forms 16 & 17 and then declared it could not find sub main. I thought that Form1 was the default loader and my splash screen
    was form1. where should I put a sub main and would that force the loading of all 20 other forms?

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Is Sub Main Really Necessary?

    Sub Main is necessary if you don't want a Form

  3. #3
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Is Sub Main Really Necessary?

    add a .bas, put a sub_main in it, have the only line be form1.show, change your startup object to sub_main and you should be all set.

    But yeah, sub_main is only necessary if you don't have a form. The above is hopefully a workaround for you.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2007
    Posts
    3

    Re: Is Sub Main Really Necessary?

    Thanks ALL!!

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Is Sub Main Really Necessary?

    Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer. Also if someone has been particularly helpful, or even particularly unhelpful, you have the ability to affect a their forum "reputation" by rating their post. Your rating won't actually count until you have 20 posts, but the person you rate will see it and know that you appreciate their help.

  6. #6
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: Is Sub Main Really Necessary?

    If you open up Project/Project Properties you can set the startup object.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width