Public SUB and FUNCTION in GLOBAL.ASA for rest of ASP pages to use?

N

Noozer

Can I create a Function or Sub in my GLOBAL.ASA file for all pages of my
application to use? If not, how does one do this?

For example, I have an "IIF" function since it isn't natively implemented in
ASP. Currently I have an Include directive on every page that includes the
scripting for this function. I'd rather just declare it once, globally.

'--- Provide IIF functionality to ASP -------------------------------
Function IIF(eval, trueVal, falseVal)
if (eval) then
IIF=trueVal
else
IIF=falseVal
end if
End Function

Thx!
 
R

Ray Costanzo [MVP]

Sadly, no, you cannot do this. You have to continue doing what you're
doing, basically.

Ray at work
 
B

Bob Barrows [MVP]

Noozer said:
Can I create a Function or Sub in my GLOBAL.ASA file for all pages of
my application to use? If not, how does one do this?

For example, I have an "IIF" function since it isn't natively
implemented in ASP. Currently I have an Include directive on every
page that includes the scripting for this function. I'd rather just
declare it once, globally.

'--- Provide IIF functionality to ASP -------------------------------
Function IIF(eval, trueVal, falseVal)


Other than creating a dll with a type library (so you can use a META tag in
global.asa to reference it) containing your custom functions, you're pretty
much stuck with using include files.

Bob Barrows
 
N

Noozer

Bob Barrows said:
Other than creating a dll with a type library (so you can use a META tag
in
global.asa to reference it) containing your custom functions, you're
pretty
much stuck with using include files.

Thanks... this at least would allow me to build a common library for things
I use often. I'll do some searching.

Do you have any "howto" sites offhand that would point me in the right
direction? (or any reasons that I wouldn't want to do this?)
 

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,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top