procedure SetArrayLength(var Arr: Array; I: LongInt);
Sets the length of an array. Always call SetArrayLength before accessing the elements in an array.
If the array is shared with another variable, SetArrayLength copies it only when the length changes. See Language differences compared to Delphi.