DelphiDigest
65 subscribers
226 photos
13 videos
11 files
1.09K links
Download Telegram
#ObjectPascalNotes

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
$IFDEF
compile directives.
#ObjectPascalNotes

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.