Solution to redefinition errors caused by repeated include of paip. asp

Source: Internet
Author: User

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 ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.