1. Computing

Delphi for .NET FCL Examples Reference

Fast Forward to Delphi for .NET - Part VI

By

This is the sixth article in the series of articles designed with one goal in mind: to provide a quick and dirty introduction to the world of .Net programming with Delphi.

As discussed in the An Introduction to the .NET Framework Class Library article, the .NET Framework Class Library (FCL) consists of a series of classes, interfaces, and value types that can be used to program with.

Delphi for .NET FCL Examples Reference

Here you can locate Delphi language code examples of some of the most important FCL classes.

System

  • Convert - converts a base data type to another base data type
  • DateTime - represents an instant in time, typically expressed as a date and time of day.
  • Delegate - a data structure that refers to a static method or to a class instance and an instance method of that class
  • Enum - provides the base class for enumerations
  • Environment - provides information about, and means to manipulate, the current environment and platform
  • EventArgs - is the base class for classes containing event data
  • Guid - represents a globally unique identifier (GUID)
  • Random - represents a pseudo-random number generator, a device that produces a sequence of numbers that meet certain statistical requirements for randomness.

System.Collections

  • ArrayList - implements the IList interface using an array whose size is dynamically increased as required
  • BitArray - manages a compact array of bit values, which are represented as Booleans, where true indicates that the bit is on (1) and false indicates the bit is off (0).
  • CollectionBase - provides the abstract base class for a strongly typed collection
  • Comparer - compares two objects for equivalence, where string comparisons are case-sensitive
  • DictionaryBase - provides the abstract base class for a strongly typed collection of key-and-value pairs
  • HashTable - represents a collection of key-and-value pairs that are organized based on the hash code of the key
  • Queue - represents a first-in, first-out collection of objects
  • SortedList - represents a collection of key-and-value pairs that are sorted by the keys and are accessible by key and by index
  • Stack - represents a simple last-in-first-out collection of objects

System.Collections.Specialized

  • HybridDictionary - implements IDictionary by using a ListDictionary while the collection is small, and then switching to a Hashtable when the collection gets large
  • ListDictionary - implements IDictionary using a singly linked list. Recommended for collections that typically contain 10 items or less
  • StringCollection - represents a collection of strings
  • StringEnumerator - supports a simple iteration over a StringCollection

System.IO

  • Directory - exposes static methods for creating, moving, and enumerating through directories and subdirectories.
  • DirectoryInfo - exposes instance methods for creating, moving, and enumerating through directories and subdirectories.
  • File - provides static methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects.
  • FileInfo - provides instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects.
  • FileStream - exposes a Stream around a file, supporting both synchronous and asynchronous read and write operations.
  • Path - performs operations on String instances that contain file or directory path information. These operations are performed in a cross-platform manner.
more to come...

Why Delphi for .NET code examples? As you probably (unfortunately) know, Delphi for .NET (Delphi 8 and Delphi 2005) code examples are no longer included in the Help system. By building a product on top of the .NET Framework Borland had a major challenge. Given that the Framework includes its own Microsoft-owned documentation for its FCL classes (and much more).

This section of the About Delphi Programming site provides a through example-reference to the Delphi for .NET FCL capabilities. Every class is presented with a class declaration and is described in a few to-the-point words, with downloadable sample code (a console mode application). What's more, exactly the same source sample provided with MSDN are used (converted to Delphi language).

©2014 About.com. All rights reserved.