#ObjectPascalNotes
Object Pascal uses a single pass compiler, so it cannot paste in the code of a function it hasn't compiled yet.
Object Pascal uses a single pass compiler, so it cannot paste in the code of a function it hasn't compiled yet.
#ObjectPascalNotes
Whenever you call an API for a given platform in your Object Pascal code you lose the ability to recompile the application for any other platform than the specific one. The exception is if the call is surrounded by platform specific
Whenever you call an API for a given platform in your Object Pascal code you lose the ability to recompile the application for any other platform than the specific one. The exception is if the call is surrounded by platform specific
$IFDEFcompile directives.
#ObjectPascalNotes
Static arrays immediately take up a lot of memory (in the case above on the stack), which should be avoided. The AllYear variable requires 8,928 Integers, taking up 4 bytes each, this is almost 35KB. Allocating such a large block in the global memory of on the stack is really a mistake. A dynamic array, instead, uses the heap memory, and offers much more flexibility in terms of memory allocation and management.
type
TAllYearTemps = array [1..24, 1..31, 1..12] of Integer;
var
AllYear: TAllYearTemps;
Static arrays immediately take up a lot of memory (in the case above on the stack), which should be avoided. The AllYear variable requires 8,928 Integers, taking up 4 bytes each, this is almost 35KB. Allocating such a large block in the global memory of on the stack is really a mistake. A dynamic array, instead, uses the heap memory, and offers much more flexibility in terms of memory allocation and management.