Does ASP Classic have a feature that is the equivalent of PHP’s “include once” feature?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I know this is an old topic, but I thought I’d add my two cents in case anyone’s interested.
I wrote a function that does precisely what you want: includes the given file exactly one no matter how many times it was called.
Notes:
The dictionary must be persistent through all includes, whereas persisting the fso merely avoids reconstructing it. If you don’t like the idea of keeping them around after the imports are done, you could modify the class to get syntax like this: