Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
REDIM takes more resources than DIM?
#26
Dynamic arrays are always created when no constant value is specified in the DIM statement - but also arrays declared as COMMON are declared dynamically.

OK, that's how it works. But I stick to my opinion that I have already expressed: Personally, I think it is wrong to declare an array with ReDim... that is confusing. For me, the clear line is lost.

Code: (Select All)

Option Base 1

ReDim As Integer feld(5, 5)

feld(1, 2) = 3
Print feld(1, 2)

ReDim feld(4, 7)

feld(3, 5) = 12
Print feld(3, 5)

ReDim feld(5, 5)

feld(2, 2) = 7
Print feld(2, 2)

'---------------------------------------

Dim As Integer a, b

'Jetzt wird feld2() dynamisch deklariert
'Now the array is created dynamically.
a = 5
b = 7
Dim As Integer feld2(a, b)

feld2(2, 2) = 8
Print feld2(2, 2)

ReDim feld2(b, a)

feld2(4, 2) = 10
Print feld2(4, 2)
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 Kernelpanic - 07-18-2024, 05:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Preserving multi-dim arrays Pete 5 416 12-19-2025, 03:17 PM
Last Post: Dimster
  packaging resources tool TempodiBasic 6 580 09-22-2025, 11:16 PM
Last Post: TempodiBasic
  DIM AT -- feature request Jack 2 711 08-15-2023, 12:15 AM
Last Post: grymmjack
  REDIM, TYPE, and STRING Woes TerryRitchie 16 3,142 04-13-2023, 05:17 AM
Last Post: DSMan195276
  suggestion: initialize array values within the DIM statement bobalooie 19 3,352 12-22-2022, 06:46 PM
Last Post: Kernelpanic

Forum Jump:


Users browsing this thread: 1 Guest(s)