The Operator

The @ operator returns the address of a variable, or of a function, procedure, or method; that is, @ constructs a pointer to its operand. For more information about pointers, see Pointers and pointer types. The following rules apply to @.

  • If X is a variable, @x returns the address of X. (Special rules apply when X is a procedural variable; see Procedural types in statements and expressions.) The type of @x is Pointer if the default {$T} compiler directive is in effect. In the {$t+} state, @x is of type at, where t is the type of X (this distinction is important for assignment compatibility, see Assignment-compatibility).
  • If f is a routine (a function or procedure), @f returns F's entry point. The type of @f is always Pointer.
  • When @ is applied to a method defined in a class, the method identifier must be qualified with the class name. For example,
  • TMyClass.DoSomething points to the DoSomething method of TMyClass. For more information about classes and methods, see Classes and objects.

Note: When using the @ operator, it is not possible to take the address of an interface method as the address is not known at compile time and cannot be extracted at runtime.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment