Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 361801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:11:02+00:00 2026-05-12T13:11:02+00:00

I use dynamic arrays a great deal and have no problems with the SetLength

  • 0

I use dynamic arrays a great deal and have no problems with the SetLength and Finalize procedures.

I recently had cause to use dynamic arrays where each array element could itself contain a variable number of elements. The declaration is like this:

TScheduleArray =  array of array of array [1..DaysPerWeek] of TShiftType;

The software is working fine, I’ve not got a problem with how to use this structure. You call SetLength on the main array and then can call SetLength again on each array element. This is working as expected.

SetLength(MyArray, 1);
SetLength(MyArray[0], 2);

My question is this: When I come to free up the resources used for this array, do I just call Finalize on the array variable:

Finalize(MyArray);

or does each array element also need to be Finalized, as each element is a dynamic array itself?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:11:02+00:00Added an answer on May 12, 2026 at 1:11 pm

    The arrays are managed by the compiler and don’t need to be finalized. If TShiftType is a class, you’ll have to free the objects manually, one at a time, but the array itself will be disposed of properly when it goes out of scope.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some dynamic int * arrays that I would like to use as
I can create and use dynamic two dimensional array in Fortran (in 77 standard).
I have a stylesheet that makes use of exslt:dynamic module and more precisely, it
I am using the following code to create dynamic 2D array. uint32_t** arrays =
Possible Duplicate: Dynamic array in Stack? How do compilers treat variable length arrays Someone
I'm experimenting with SplFixedArray. I have some work done with dynamic arrays which i'm
I could use some guidance on specifying a dynamic multi dimensional array in javascript.
I have created a simple dynamic array in C. typedef struct varray_t { void
How am I supposed to use dynamic memory allocations for arrays? For example here
I tried to use forall to allocate dynamic arrays, but gfortran didn't like that.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.