469,270 Members | 1,170 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

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


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
1 1793
"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.

Similar topics

1 post views Thread by Scott Shaw | last post: by
6 posts views Thread by Stephane Belzile | last post: by
3 posts views Thread by Richard Thornley | last post: by
2 posts views Thread by Brian Tkatch | last post: by
13 posts views Thread by Allen | last post: by
7 posts views Thread by The Cool Giraffe | last post: by
29 posts views Thread by RageARC | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.