In case of a dynamic array type, the initial length of the array is zero. The actual length of the array must be set with the standard SetLength function, which will allocate the necessary memory for storing the array elements.
Now the array a have a valid array index range from 0 to 999: the array index is always zero-based.