O'Reilly logo

Delphi for .NET Developer’s Guide by Xavier Pacheco

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required