Author |
Topic  |
davemaxwell
Access 2000 Support Moderator
    
USA
3020 Posts |
Posted - 30 April 2003 : 14:45:39
|
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 |
 |
|
Lweast
Starting Member
29 Posts |
Posted - 30 April 2003 : 16:05:49
|
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. |
 |
|
DavidRhodes
Senior Member
   
United Kingdom
1222 Posts |
Posted - 30 April 2003 : 16:18:47
|
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 |
 |
|
DavidRhodes
Senior Member
   
United Kingdom
1222 Posts |
Posted - 30 April 2003 : 16:22:51
|
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 |
 |
|
Lweast
Starting Member
29 Posts |
Posted - 30 April 2003 : 16:32:07
|
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. |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 30 April 2003 : 18:54:02
|
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 |
 |
|
Topic  |
|