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

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

am 10.10.2007 16:37:04 von 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 ...

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

am 10.10.2007 17:35:14 von Dave Anderson

"wbsurfver@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.