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

W

wbsurfver

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

Dave Anderson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top