Re: Option Explicit



Actually, I suspect it will be slightly faster to have all of the variables
declared, as Access will have reserved memory for all of them in advance,
rather than having to reserve memory as they're encountered. I doubt,
however, that the difference will be that significant.

However, as we've all told you, you personally can save hours of effort
trying to debug your code when it isn't working properly if you use Option
Explicit and declare your variables.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Warrio" <warrio@xxxxxxxxxxx> wrote in message
news:46782b64$0$3821$5402220f@xxxxxxxxxxxxxxxxxx
So the statement written in the Performance Analyser tool "Using an Option
Explicit statement will enable your code to run faster." is wrong?

does it deal only with the compling time or also with the runtime?




"Rick Brandt" <rickbrandt2@xxxxxxxxxxx> a écrit dans le message de news:
ZSVdi.20554$C96.19386@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Warrio wrote:
Thanks for your quick answer! but sorry I forgot to mention in which
way it would help Access to run my code faster ?

and so far, I'm happy to have the choice to declare or not my
variables and set their type, but I'm ready to change my habits ONLY
if it can help my forms run and load faster (you made your choice, I
can have a different one) ...
the main part of my forms performances is dealing with the sql
requests and actions. but how much will I win if I use "Option
Explicit" knowing that today users have 1 to 2 GB processors...

Thanks again!

It has nothing to do with speed. It has to do with catching silly typing
errors at compile time instead of having them fail at runtime.

If you like taking silly risks then go ahead and leave it out.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com






.



Relevant Pages

  • Re: option explicit
    ... Explicit", it might be moments of debugging time instead of hours. ... And one more reason I like it is that when I declare an object explicitly: ... dim myWksThatShowsTheSummary as Worksheet ... I can type mywks and hit ctrl space bar to have the VBE autocomplete (or show me ...
    (microsoft.public.excel.misc)
  • Re: Must declared length of a character function be matched by any procedure declaring it? YES
    ... length that any routine that used the function had to declare it to be ... end function bigfunc ... The reason that the error is not detected is that there is no explicit ... a character function can return a string ...
    (comp.lang.fortran)
  • Re: Garbage collection
    ... As you know very well, a GC has advantages and drawbacks, both technical and human ("no free beer" (TM)), so, imho, there are sometimes situations in which a GC is recommended, but sometimes not. ... An on/off global switch per project is in fact rather a one-way road (tell me, what would you do if you have a project with GC enabled and you decide that for eg. speed reasons, avoiding sloppy code aso. ... That's why I tried to propose an approach to allow the developer to explicitly declare what's GCed or not by using both inclusion and exclusion filtering declarative approach. ... Imho, the GC situation now is something similar with 'var' declaration explicit in Pascal, implicit in VB. ...
    (borland.public.delphi.non-technical)
  • Re: Are these good features to use?
    ... as it's good to explicitly declare what I'm creating. ... You can't use "var" without losing human-readable type information in all scenarios and it's not even legal in other scenarios, so there will always be some variables that should or must be declared with an explicit type. ... With the auto-property, it's an easily recognized pattern and reading it you immediately know everything there is to know about the property. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: lang effort: type conversions
    ... inferencer for the lang I am implementing, I have started to consider some ... Yes I have came to the same idea of using a variant type with either ... explicit declaration or invisible syntatic sugar like you are in functions. ... will declare a mutable one. ...
    (comp.lang.misc)

Loading