Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Improving Speed - Option Explicit, Global.asa, etc
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 30 April 2003 :  14:45:39  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
quote:
Originally posted by Doug G

quote:
Perhaps more important, it turns out that declared variables are faster than undeclared variables. Under the covers, the scripting run time references undeclared variables by name, every time they are used. Declared variables, on the other hand, are assigned an ordinal, either at compile time or run time. Subsequently, declared variables are referenced by this ordinal. Since Option Explicit forces variable declaration, it insures that all variables are declared and thus will be accessed quickly.

Testing disproves this?



I think we're talking semantics here. What we're saying is that all things being equal (ie. all variables are dimmed), that the system will run slightly faster without Option Explicit. Option Explicit is great for development to be sure that all the fields are dimmed, but when you go to prod, you don't need it on (since what you tested should be the same as what you impliment).

Dave Maxwell
Barbershop Harmony Freak
Go to Top of Page

Lweast
Starting Member

29 Posts

Posted - 30 April 2003 :  16:05:49  Show Profile
Commonly done in another dialect that I use...

A variable is set in the first include file (here we could possibly use config.asp) that indicates if the source is development or production code.
The Option Explicit is then activated only while b_Development is true.
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 30 April 2003 :  16:18:47  Show Profile
quote:
Originally posted by Lweast

Commonly done in another dialect that I use...

A variable is set in the first include file (here we could possibly use config.asp) that indicates if the source is development or production code.
The Option Explicit is then activated only while b_Development is true.



can you do that?
do you mean something like
if developmentserver then
option explicit
end if

To be honest i've never tried this, I thought you had to put option explicit on the first line

The UK MkIVs Forum
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 30 April 2003 :  16:22:51  Show Profile
quote:
Originally posted by bjlt

Which is better, to put the meta tag in config.asp instead of the include there or in global.asa ?



Good question, strictly speaking the global.asa is better but if it can be done in config.asp that would be ok.

The UK MkIVs Forum
Go to Top of Page

Lweast
Starting Member

29 Posts

Posted - 30 April 2003 :  16:32:07  Show Profile
According to the ASP documentation Option Explicit must come before ANY variable declaration so a variable is out in this case.
It should work ok for Directives however.
I have used this in PowerBasic and it rely's on the %Debug directive.
I see in the ASP docs that there are only four documented directive's.

Perhaps a system variable would work.
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 30 April 2003 :  18:54:02  Show Profile
quote:
Originally posted by davemaxwell

quote:
Originally posted by Doug G

quote:
Perhaps more important, it turns out that declared variables are faster than undeclared variables. Under the covers, the scripting run time references undeclared variables by name, every time they are used. Declared variables, on the other hand, are assigned an ordinal, either at compile time or run time. Subsequently, declared variables are referenced by this ordinal. Since Option Explicit forces variable declaration, it insures that all variables are declared and thus will be accessed quickly.

Testing disproves this?



I think we're talking semantics here. What we're saying is that all things being equal (ie. all variables are dimmed), that the system will run slightly faster without Option Explicit. Option Explicit is great for development to be sure that all the fields are dimmed, but when you go to prod, you don't need it on (since what you tested should be the same as what you impliment).


Thanks, Dave

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07