Variable scope

Can the scope of a variable be narrower than a single event handler. For example, could you have a variable that was local to a loop or local to an if statement within an event handler subroutine?

Write a small test program to justify your answer this question.


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.