-
Includes
I am trying to make a Code Library with all my most used functions in so I
can just include them and use them. The problem is when a program includes
an include that also includes something that has already been included (tongue
twister).
ie.
Program A - Includes B and C.
But include B also includes C. So when the program tries to include C it
has already been included. Is there any way of detecting what has already
been included?
Cheers Gav
-
Re: Includes
"Gav" <gavin.metcalfe@portakabin.com> wrote in message
news:3ac85218$1@news.devx.com...
>
> I am trying to make a Code Library with all my most used functions in so I
> can just include them and use them. The problem is when a program includes
> an include that also includes something that has already been included
(tongue
> twister).
>
> ie.
> Program A - Includes B and C.
>
> But include B also includes C. So when the program tries to include C it
> has already been included. Is there any way of detecting what has already
> been included?
>
> Cheers Gav
The same way we do it with C programming. At the top of each file, define a
variable or constant. Before including that file, check for the existence of
that variable - if it exists don't include that file.
Mike
www.cross-browser.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|