Source: Http://i.cnblogs.com/EditPosts.aspx?opt=1
As with the ansistring type, dynamic arrays are defined for compatibility with dynamic arrays in Delphi, where dynamic arrays are used in the form of templates (template), and dynamic arrays are defined as follows:
Template class Delphireturn Dynamicarray;
So we have to specify a definite basic data type when we use it, for example, to define a dynamic array arrayofint of type int, which is defined in the following format:
Dynamicarray Arrayofint;
How do you dynamically change the size of an array? The Dynamicarray class has a property length, so that you can change the size of the array simply by changing the value, for example, to set the length of the Arrayofint to 10:
arrayofint.length=10;
In particular, if you want to release a dynamic array, just set the length to 0, what? Simple enough, huh?
There are not many properties and methods of Dynamicarray, as I will explain below.
high |
int |
read-only, upper bound of dynamic array, Length-1. |
low |
int |
read-only, dynamic array of the lower bound, Huan is 0. |
length |
int |
set/return the length of the dynamic array, set to 0 to release the array |
copy () |
  |
Copy the contents of a dynamic array to another dynamic array, such as Tmp=a_data. Copy (); both must be of the same type. |
copyrange (int startindex,int count) |
  |
Copy a dynamic array to specify the contents of the range to another dynamic array, the first parameter is the starting position, the second parameter is the number of copies, |
= |
|
assigned value. Just generate a variable name that points to this array, and if you want to generate a copy, you must use the copy () method. |
== |
  |
comparison. |
[] |
  |
Remove the label. |
In this way, we can use dynamic arrays in BCB, and using flexible dynamic arrays in powerful, flexible BCB is not a pleasant thing to do?
Use of dynamic arrays in C++builder (RPM)