What are LOCAL and GLOBAL variables?

Local variables lifetime ends when the Procedure ends. Global variables lifetime begins at the start of the
script and ends at the end of the script and it can be used by any procedure within the script. Declaring a
variable by using the keyword PRIVATE makes the variable global within the script, but if declared using PUBLIC, then all scripts can refer the variable.

Showing Answers 1 - 4 of 4 Answers

Local variables are the variables which are declared within the scope of a method.Local variables are not accesses outside the scope of a method.

Global variables are the which are declared outside the method definition.Global variables are accesible anywhere.

  Was this answer useful?  Yes

lalita.p

  • Jun 7th, 2007
 

Local Variable: The scope of the local variable is for the procedure in which they are declare. Which are called procedural level variable. Which are local to the procedure. The variables which are declare outside the procedure in option explicit whose scope is local to the form in which they are declare.

Global variables are the variables whose scope is throughout the applicaiton. Usually used in module are class.

  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