Reputation: 343
Say i have
ArrayOfTXSDecimal = array of TXSDecimal;
Then during runtime i do
Ids := ArrayOfTXSDecimal.create(14450);
What did i just create? an array(ids) with 14450 indexs or just index 14450
Upvotes: 0
Views: 175
Reputation: 596156
You are creating a dynamic array with one element whose value is 14450. You are doing the equivalent of this:
SetLength(Ids, 1);
Ids[0] := 14450;
This Create()
syntax for dynamic arrays is documented on Embarcadero's DocWiki:
An alternative method of allocating memory for dynamic arrays is to invoke the array constructor:
type TMyFlexibleArray = array of Integer; begin MyFlexibleArray := TMyFlexibleArray.Create(1, 2, 3 {...}); end;
which allocates memory for three elements and assigns each element the given value.
Upvotes: 5