Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Enterprise
Expertise: Beginner
Jun 7, 2001



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Encapsulate Your Main Body in a Main Subroutine

Global variables can lead to problems that are difficult to debug. It is very easy, for instance, to accidentally access a global variable from a function when you think you are using a local variable. All variables that you declare in ASP outside of functions are of global scope to the ASP.

To avoid incidental global variables, you can create a Main subroutine as the entry point for the ASP. Any variables you declare within Main are local to it, so you significantly reduce the number of global variables. Main is then called from within the page as the starting point for the page.
Trong Ha
Thanks for your registration, follow us on our social networks to keep up-to-date