Absolute Addresses You can create a new variable that resides at the same address as another variable. To do so, put the directive
absolute after the type name in the declaration of the new variable, followed by the name of an existing (previously
declared) variable. For example,
var
Str: string[32];
StrLen: Byte absolute Str;
specifies that the variable
StrLen
should start at the same address as
Str
. Since the first byte of a short string
contains the string's length, the value of
StrLen
is the length of
Str
.
You cannot initialize a variable in an absolute declaration or combine absolute with any other directives.