Re: Array Integers vs Array Variables
From: Roland Hall (nobody_at_nowhere)
Date: 02/08/04
- Next message: Khaled Omar: "ASP_0147|500_Server_Error"
- Previous message: Ray at <%=sLocation%> [MVP]: "Re: SessionId Property exists or not"
- In reply to: Ray at <%=sLocation%> [MVP]: "Re: Array Integers vs Array Variables"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 8 Feb 2004 06:38:50 -0600
"Ray at <%=sLocation%> [MVP]" wrote:
: "Roland Hall" <nobody@nowhere> wrote in message
: news:OBrvzDj7DHA.2404@TK2MSFTNGP11.phx.gbl...
: > "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
- Next message: Khaled Omar: "ASP_0147|500_Server_Error"
- Previous message: Ray at <%=sLocation%> [MVP]: "Re: SessionId Property exists or not"
- In reply to: Ray at <%=sLocation%> [MVP]: "Re: Array Integers vs Array Variables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|