Redefinition error caused by repeated include of paip. asp
When ASP files are repeatedly included, especially when different development files are included, repeated include may occur.
A name redefinition error occurs ..
It is mainly because the variable definition is repeated .. For example, dim ..
The function name can be repeated and does not matter. However, use the function in the file that is finally included ..
The solution is simple:
1. Remove option explicit so that variables can be defined without dim
2. Do not use dim to define variables. Just write the variables directly .. More convenient .. Of course, if a variable is misspelled, you only need
It is okay to perform one-step tracking and debugging .. No big deal ..
3. If an array exists, use redim to implement the definition .. Otherwise, it will be used as a function, resulting in errors ..
4. strictly define dim variables if necessary. Do not use global script variables. You can call the get function instead.
..
Public in vbs .. Private definition, but can only play a role in writing class...
The variable public in the script .. Private does not work. All are global variables by default. Global functions ..