Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB.Net modules

Posted on 2006-05-06
4
Medium Priority
?
407 Views
Last Modified: 2010-04-17
I think we can create many modules in an application.
If we create a sub main in each module which one will be executed first when the application starts?
what is the scope of the variable declared in a module with Private/Public/Dim?

Thanks
0
Comment
Question by:jskfan
  • 3
4 Comments
 
LVL 7

Expert Comment

by:dttri
ID: 16621995
Hello,
If you have many classes that has the Sub Main(), then use the command:

vbc file1.vb file2.vb /main:ThisClass

to instruct the compiler that the Sub Main() in ThisClass will be the entry point (start up point) for the program.

The scope of the declare are as follow:
Public: every module will see this field
Private: only the object of the current class can see this field
0
 
LVL 7

Expert Comment

by:dttri
ID: 16622014
You should use "Dim" when declare local variable, for class member variables use should use Public/Private instead.
0
 

Author Comment

by:jskfan
ID: 16622135
<<<<If you have many classes that has the Sub Main(), then use the command:

vbc file1.vb file2.vb /main:ThisClass>>>>>>>>>>

do you mean many modules by saying many classes?
0
 
LVL 7

Accepted Solution

by:
dttri earned 750 total points
ID: 16622147
Hi,
You can store many classes in 1 file (1 module), each class can contain 1 Main(), so the command I mention tell the compiler which Main() will be the entry point for our program.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Progress

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question