Programming Languages VBScript Subjective
May 10, 2013

What's the scope of variable in VBScript?

Detailed Explanation

 

Generally scope of the variable means we can set an variable can access in whole function or it only access by its local instance.Because of scode of variable we can say variable are of two types Local and Global variables.

I have explain this with an example.

<script> Dim name Sub cmdclickme_OnClick Dim age End Sub </script>

In this example we declare variable 'name' outside the sub procedure.So, 'name' variable is worked as global variable it can access by all procedure in all script of web page.But we declare 'age' variable inside the sub procedure. So, age variable only accessed with in the sub procedure.Than we can say that 'age' is an local variable.

 

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback