By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,190 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,190 IT Pros & Developers. It's quick & easy.

How can I detect if a class is included more than once ?

P: n/a

Here is the problem, I am working with a bunch of old code so I can
really restructure the includes, otherwise I guess I could change all
the #include statements to #include-once.

Anyway, If I have a file with a class like this:

Class myClass
end class

I get a "name redefined" error. I've been seeing these and indeed from
goolge searches, it's because the file is somehow included more than
once. This problem doesn't occur for functions and the old code bases
just used functions whereas I would like to add some classes.

In C you used to be able to detect that at the top of the file and not
included the rest of the file
if it is allready included. I just want to at least detect it so I
don't redeclare the class ...

Thanks, I'm new to ASP, but I have som,e books ...

Oct 10 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"wb*******@yahoo.com" wrote:
I get a "name redefined" error. I've been seeing these and indeed
from goolge searches, it's because the file is somehow included
more than once. This problem doesn't occur for functions and the
old code bases just used functions whereas I would like to add
some classes.

In C you used to be able to detect that at the top of the file and
not included the rest of the file if it is allready included. I
just want to at least detect it so I don't redeclare the class
...
I don't see any way to do this in ASP. The parser gathers all of the
#include files and assembles the script before evaluating a single line of
(VB|J)Script.
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Oct 10 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.