Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Public SUB and FUNCTION in GLOBAL.ASA for rest of ASP pages to use? (http://www.velocityreviews.com/forums/t799187-public-sub-and-function-in-global-asa-for-rest-of-asp-pages-to-use.html)

Noozer 07-19-2005 07:24 AM

Public SUB and FUNCTION in GLOBAL.ASA for rest of ASP pages to use?
 
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!



Ray Costanzo [MVP] 07-19-2005 01:44 PM

Re: Public SUB and FUNCTION in GLOBAL.ASA for rest of ASP pages to use?
 
Sadly, no, you cannot do this. You have to continue doing what you're
doing, basically.

Ray at work

"Noozer" <dont.spam@me.here> wrote in message
news:CU1De.1982318$6l.1516499@pd7tw2no...
> 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!
>
>




Bob Barrows [MVP] 07-19-2005 01:59 PM

Re: Public SUB and FUNCTION in GLOBAL.ASA for rest of ASP pages to use?
 
Noozer wrote:
> 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

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Noozer 07-19-2005 08:19 PM

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

"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:OuX0LoGjFHA.1968@TK2MSFTNGP14.phx.gbl...
> Noozer wrote:
>> 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.


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?)




All times are GMT. The time now is 05:34 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.