Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
REDIM takes more resources than DIM?
#27
Cool, This is a good point, and something I can't quite off-hand come up with a reason why a variable can be used to avoid a numerically assigned array duplicate definition error...

Code: (Select All)

a = 5
b = 7
' This first half assigns a variable to each array and works.
Dim x(a)
For i = 1 To a: Print i; x(i): Next
Print "-----------------"
ReDim x(b)
For i = 1 To b: Print i; x(i): Next
Print "-----------------"

' This second half assigns numbers to the arrays, and errors out at line 15.
Dim y(5)
For i = 1 To a: Print i; x(i): Next
Print "-----------------"
ReDim y(7)
For i = 1 To b: Print i; x(i): Next

Pete
Reply


Messages In This Thread
REDIM takes more resources than DIM? - by bplus - 07-17-2024, 12:21 AM
RE: REDIM takes more resources than DIM? - by Pete - 07-18-2024, 07:51 PM



Users browsing this thread: 10 Guest(s)