
dim at procedure level or module level
Quote:
> > It will take almost no time to create the variables, but it could take a
> > little time to set them to 0. If you are doing that anyway, there would
be
> > no difference. Local value variables, such as Longs and Singles, are
> > created on the stack in a single step, regardless of how many there are.
> > The total number of bytes required is added to the stack pointer -
voila,
> > variables created. For things like strings and objects, 4 byte pointers
> > are created the same way at the same time.
> It's been while since I've looked at VB6 disassembled but from memory
local
> variables will start as registers and might be pushed to the stack.
> In answer to the OPs question, I doubt it will improve speed, generally
> communication with your external device will take most of the time. It
could
> even reduce speed as the variables might not be in registers any more.
Local variables or auto variables are placed on the stack. However, one or
two may occasionally be placed in the register due to optimization. (Which
is one reason to avoid a 'global'.) In some context one might profit from
some variables to be declared as Static.
"Thought experiments" in these cases are seldom useful. It is best to test.
<g>
-ralph