Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
REDIM takes more resources than DIM?
#7
The function of Redim has been discussed ad nauseam here, but somehow it doesn't seem to get through.

Again: A static array is set to zero with Erase. That's all you need. Redim cannot be used here.

A dynamic array is reinitialized with Redim; the dimension cannot be changed. Two-dimensional to three-dimensional is not possible. If Erase is used on a dynamic array, you can't see anything, absolutely nothing, because a dynamic array only exists while the program is running. That's why you can't set it to zero! Erase frees up the array's memory space again; that doesn't work with static arrays.

Redim: Is a combination of Erase and Dim. Without Redim, you would first have to erase a dynamic array with Erase and then reinitialize it with Dim.
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-17-2024, 12:09 PM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)