Default()
>:D
Is there a better way to initialize Array1 other than declaring every member?If you need to initialize only with zeros, you can do this:
Default()
>:D
const W: TWrapper = ();
I can't find where the "= ()" is in the documentation. Would you happen to have a link where that construction is documented ?
If you skip fields the compiler will warn that fields are missing which is why ASerge disabled warning 3177. Though I have to admit that I hadn't expected that to work without any fields... :-[That's what I expected as well. "Normally" when initializing a static (in the C sense) array and elements are missing, the compiler usually emits an error stating that it expected "x" additional elements.
If you skip fields the compiler will warn that fields are missing which is why ASerge disabled warning 3177. Though I have to admit that I hadn't expected that to work without any fields... :-[That's what I expected as well. "Normally" when initializing a static (in the C sense) array and elements are missing, the compiler usually emits an error stating that it expected "x" additional elements.
Thank you for the link but, unless I missed it, I don't see anywhere in there that the list can be left empty (and apparently this is only possible when the array is in a record.) Should this be reported as a documentation bug ?
For constant records, each element of the record should be specified,
Of course that can be made clearer... so feel free to file a documentation bug if you want.Clearer is always desirable. Reported it as a documentation bug.
I don't know if this fits the needs but there is the Fillchar procedure that can be used to fill a memory block with the same char.Only need to do this once at the start of the program and only inside the function. We will have to put the variable outside the scope of the function (globally), which the author wanted to avoid. If we use the heap, when will we release it?