:
: : > "Ray at <%=sLocation%> [MVP]" wrote:'
: > : True, you must use an actual number when dimming an array, because the
: > array
: > : is put in memory with the Dim statement before any variables are
: > evaluated,
: > : b in this case.
: >
: > But I already dimensioned b and it is in memory and I'm just creating a
: > reference to b, aren't I?
:
:
: b has been dimmed, but it doesn't have a value yet when the code is
: compiled. It doesn't get a value (b=10) until after all the compiling has
: finished. Part of the compiling process, as I believe, is making room in
: memory for the variables (dim). That, and checking for unterminated
: strings, syntax errors, etc. So, if you're the script interpreter, you'd
go
: to declare an array in memory and see that you should make room for "b"
: elements. But you do not know what b is, as you have not yet gotten to
the
: point at which you start reading lines like "b=10." I guess you could
: parallel this logic with why you cannot do <!-- #include
: file="<%varName%>" -->. That's a different thing, of course, but the
logic
: behind why you cannot do it is the same, if that helps at all.
Yes, this with your other post that Dim is compile-time and ReDim is
run-time makes sense.
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library -
http://msdn.microsoft.com/library/default.asp