User-Defined Types

Integers, strings, and floating-point numbers often are not enough to adequately represent variables in the real-world problems that programmers must try to solve. In cases like these, you must create your own types to better represent variables in the current problem. In Delphi, these user-defined types usually come in the form of records or classes; you declare these types using the Type keyword.

Arrays

The Delphi language enables you to create arrays of any type of variable. For example, a variable declared as an array of eight integers reads like this:

var
  A: Array[0..7] of Integer;

This statement is equivalent to the following C# declaration:

int A[8];

It’s also equivalent to this Visual Basic .NET statement:

Dim A(8) ...

Get Delphi for .NET Developer’s Guide 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.