Name

Addr Function

Syntax

function Addr(var X): Pointer;

Addr(Variable)
Addr(Subroutine)

Description

The Addr function returns the address of a variable or subroutine. The return type is Pointer, that is, an untyped pointer. Even if you use the $T or $TypedAddress compiler directive, Addr always returns an untyped pointer.

The @ operator is similar to the Addr function, but the @ operator can return a typed pointer if you use the $T or $TypedAddress directive.

The Addr function is built into the compiler.

See Also

Pointer Type, $T Compiler Directive, $TypedAddress Compiler Directive

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.