|
 |
asp_web_howto thread: #includes....
Message #1 by "Owen Mortensen" <ojm@a...> on Mon, 23 Apr 2001 08:59:39 -0700
|
|
Anyone know if there's a way to see if some other file has already included
a file before including it in the current file.
For example, in C I'm used to coding like this:
(In the file to be included:
#IFNDEF file_h
#DEFINE file_H
#ELSE
....the stuff for file_H
#ENDIF)
Then I can include file.h in any number of files and it will only actually
be loaded in the _first_ file that includes it.
Is there any such functionality in ASP?
TIA,
Owen
Message #2 by Kyle Burns <kburns@c...> on Mon, 23 Apr 2001 13:26:43 -0500
|
|
ASP 2.0 does not have a built-in way to do conditional includes. One
possible solution is to encapsulate your code in functions and conditionally
call those functions. You can set a variable to indicate whether you have
called the function yet to avoid calling it again.
>> -----Original Message-----
>> From: Owen Mortensen [mailto:ojm@a...]
>> Sent: Monday, April 23, 2001 11:00 AM
>> To: ASP Web HowTo
>> Subject: [asp_web_howto] #includes....
>>
>>
>> Anyone know if there's a way to see if some other file has
>> already included
>> a file before including it in the current file.
>>
>> For example, in C I'm used to coding like this:
>>
>> (In the file to be included:
>> #IFNDEF file_h
>> #DEFINE file_H
>> #ELSE
>> ....the stuff for file_H
>> #ENDIF)
>>
>> Then I can include file.h in any number of files and it will
>> only actually
>> be loaded in the _first_ file that includes it.
>>
>> Is there any such functionality in ASP?
>>
>> TIA,
>> Owen
>>
>>
>> ---
>> SoftArtisans helps developers build robust, scalable Web
>> applications!
>> Excel Web reports, charts:
>> http://www.softartisans.com/excelwriter.html
>> File uploads: http://www.softartisans.com/saf.html
>> Transactional file management: http://www.softartisans.com/saf1.html
>> Scalability: http://www.softartisans.com/saxsession.html
>> ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html
>> $subst('Email.Unsub')
>>
Message #3 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Tue, 24 Apr 2001 09:40:14 +0100
|
|
you cannot have conditional include files as files are included before any
script is executed
-----Original Message-----
From: Owen Mortensen [mailto:ojm@a...]
Sent: Monday, April 23, 2001 5:00 PM
To: ASP Web HowTo
Subject: [asp_web_howto] #includes....
Anyone know if there's a way to see if some other file has already included
a file before including it in the current file.
For example, in C I'm used to coding like this:
(In the file to be included:
#IFNDEF file_h
#DEFINE file_H
#ELSE
....the stuff for file_H
#ENDIF)
Then I can include file.h in any number of files and it will only actually
be loaded in the _first_ file that includes it.
Is there any such functionality in ASP?
TIA,
Owen
________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com
|
|
 |