Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Preserving multi-dim arrays
#2
Isn't the simplest way for multi-dim arrays:
Make a new array the size you want.
Copy over the data you want to preserve.
Resize old array
Copy Data back to old array (one single memcopy now, as the arrays are the same size and have the same indexes)
Delete/Clear new array.

It's not going to be quick, but it'll get the job done.  And if you're resizing mutli-dimensional arrays constantly, you're doing something wrong.
Reply


Messages In This Thread
Preserving multi-dim arrays - by Pete - 12-18-2025, 06:18 PM
RE: Preserving multi-dim arrays - by SMcNeill - 12-18-2025, 06:21 PM
RE: Preserving multi-dim arrays - by Pete - 12-18-2025, 07:00 PM
RE: Preserving multi-dim arrays - by Dimster - 12-18-2025, 09:13 PM
RE: Preserving multi-dim arrays - by Pete - 12-18-2025, 11:49 PM
RE: Preserving multi-dim arrays - by Dimster - 12-19-2025, 03:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Arrays inside Types? Ikerkaz 11 305 6 hours ago
Last Post: Kernelpanic
  Arrays as UDTs Pete 26 1,199 02-06-2026, 04:31 AM
Last Post: bplus
  Array out of passing arrays... Pete 2 406 09-22-2025, 08:53 PM
Last Post: ahenry3068
Question REDIM takes more resources than DIM? bplus 34 5,907 07-23-2024, 01:04 PM
Last Post: luke
  Arrays of record variables Kernelpanic 0 455 04-02-2024, 06:58 PM
Last Post: Kernelpanic

Forum Jump:


Users browsing this thread: 1 Guest(s)