Describe the different scopes of variables in VB.

Showing Answers 1 - 1 of 1 Answers

fsk

  • Mar 6th, 2006
 

There are three levels of scope of variables in Visual Basic,as follows:

1. Variables declared in procedures are private to procedure.

2. Variables declared at the form or module level in the form or module's (General) section using Dim, Redim, Private, Static, or Type are form- or module-level variables. These variables are available throughout the module.

3. Variables declared at the module level in the module's(General) section using Public are global and are available throughout the project, in all forms and modules.  Note that you cannot use Public in procedures.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions