Object Pascal
Encyclopedia
Object Pascal refers to a branch of object-oriented
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...

 derivatives of Pascal
Pascal (programming language)
Pascal is an influential imperative and procedural programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.A derivative known as Object Pascal...

, mostly known as the primary programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 of Embarcadero Delphi.

Early history at Apple

Object Pascal is an extension of the Pascal language that was developed at Apple Computer
Apple Computer
Apple Inc. is an American multinational corporation that designs and markets consumer electronics, computer software, and personal computers. The company's best-known hardware products include the Macintosh line of computers, the iPod, the iPhone and the iPad...

 by a team led by Larry Tesler
Larry Tesler
Larry Tesler is a computer scientist working in the field of human-computer interaction. Tesler has worked at Xerox PARC, Apple Computer, Amazon.com, and Yahoo!...

 in consultation with Niklaus Wirth
Niklaus Wirth
Niklaus Emil Wirth is a Swiss computer scientist, best known for designing several programming languages, including Pascal, and for pioneering several classic topics in software engineering. In 1984 he won the Turing Award for developing a sequence of innovative computer languages.-Biography:Wirth...

, the inventor of Pascal. It is descended from an earlier object-oriented version of Pascal called Clascal
Clascal
Clascal was an object-oriented programming language developed in 1983 by the Personal Office Systems division of Apple Computer....

, which was available on the Lisa
Apple Lisa
The Apple Lisa—also known as the Lisa—is a :personal computer designed by Apple Computer, Inc. during the early 1980s....

 computer.

Object Pascal was needed in order to support MacApp
MacApp
MacApp was Apple Computer's primary object oriented application framework for the Mac OS for much of the 1990s. First released in 1985, it is arguably the first such system to be widely used, notably on a microcomputer platform...

, an expandable Macintosh application framework that would now be called a class library. Object Pascal extensions and MacApp itself were developed by Barry Haynes, Ken Doyle, and Larry Rosenstein, and were tested by Dan Allen. Larry Tesler
Larry Tesler
Larry Tesler is a computer scientist working in the field of human-computer interaction. Tesler has worked at Xerox PARC, Apple Computer, Amazon.com, and Yahoo!...

 oversaw the project, which began very early in 1985 and became a product in 1986.

Apple dropped support for Object Pascal when they moved from Motorola 68K chips to IBM's PowerPC architecture in 1994.

An Object Pascal extension was also implemented in the Think Pascal IDE. The IDE includes the compiler and an editor with Syntax highlighting and checking, a powerful debugger and a class library. Many developers preferred Think Pascal over Apple's implementation of Object Pascal because Think Pascal offered a tight integration of its tools. The development stopped after the 4.01 version because the company was bought by Symantec
Symantec
Symantec Corporation is the largest maker of security software for computers. The company is headquartered in Mountain View, California, and is a Fortune 500 company and a member of the S&P 500 stock market index.-History:...

. The developers then left the project.

The Borland and CodeGear years

In 1986, Borland
Borland
Borland Software Corporation is a software company first headquartered in Scotts Valley, California, Cupertino, California and finally Austin, Texas. It is now a Micro Focus subsidiary. It was founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn.-The 1980s:...

 introduced similar extensions, also called Object Pascal, to the Turbo Pascal
Turbo Pascal
Turbo Pascal is a software development system that includes a compiler and an integrated development environment for the Pascal programming language running on CP/M, CP/M-86, and DOS, developed by Borland under Philippe Kahn's leadership...

 product for the Macintosh, and in 1989 for Turbo Pascal 5.5 for DOS.

When Borland refocused from DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

 to Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 in 1994, they created a successor to Turbo Pascal, called Delphi and introduced a new set of extensions to create what is now known as the Delphi language.

The development of Delphi started in 1993 and Delphi 1.0 was officially released in the United States on 14 February 1995. While code using the Turbo Pascal object model could still be compiled, Delphi featured a new syntax using the keyword class in preference to object, the Create constructor and a virtual Destroy destructor (and negating having to call the New and Dispose procedures), properties, method pointers, and some other things. These were inspired by the ISO working draft
Draft document
Drafting is the preliminary stage of a written work in which the author begins to develop a more cohesive product. A also describes the product the writer creates in the initial stages of the writing process.In the drafting stage, the author:...

 for object-oriented extensions, but many of the differences to Turbo Pascal's dialect (such as the draft's requirement that all methods be virtual) were ignored.

The Delphi language has continued to evolve over the years to support constructs such as dynamic array
Dynamic array
In computer science, a dynamic array, growable array, resizable array, dynamic table, or array list is a random access, variable-size list data structure that allows elements to be added or removed...

s, generics
Generic programming
In a broad definition, generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters...

 and anonymous methods
Anonymous function
In programming language theory, an anonymous function is a function defined, and possibly called, without being bound to an identifier. Anonymous functions are convenient to pass as an argument to a higher-order function and are ubiquitous in languages with first-class functions such as Haskell...

.

Versions

  • Borland
    Borland
    Borland Software Corporation is a software company first headquartered in Scotts Valley, California, Cupertino, California and finally Austin, Texas. It is now a Micro Focus subsidiary. It was founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn.-The 1980s:...

     used the name Object Pascal for the programming language in the first versions of Delphi, but later renamed it to the Delphi programming language. However, compiler
    Compiler
    A compiler is a computer program that transforms source code written in a programming language into another computer language...

    s that claim to be compatible with Object Pascal are often trying to be compatible with Delphi source code. Because Delphi is trademarked, compatible compilers continued using the name Object Pascal.

  • Embarcadero Technologies
    Embarcadero Technologies
    Embarcadero Technologies is an American computer software company that develops, manufactures, licenses, and supports a wide range of products and services related to software through its various dynamic product divisions...

    , which purchased Delphi in 2008, sells the Delphi IDE
    Integrated development environment
    An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

     that compiles the Delphi dialect of Object Pascal to Windows.

  • .NET
    .NET Framework
    The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

     support existed from Delphi 8 through Delphi 2005, Delphi 2006 and Delphi 2007, which now has been replaced by another language, Oxygene (see below), which is not fully backward-compatible.

  • The Oxygene programming language developed by RemObjects Software
    RemObjects Software
    RemObjects Software is an American software company founded in 2002 by Alessandro Federici and Marc Hoffman. It develops and offers tools and libraries for software developers on a variety of development platforms, including Embarcadero Delphi, Microsoft .NET, Mono, and Apple's...

     targets the Common Language Infrastructure
    Common Language Infrastructure
    The Common Language Infrastructure is an open specification developed by Microsoft and standardized by ISO and ECMA that describes the executable code and runtime environment that form the core of the Microsoft .NET Framework and the free and open source implementations Mono and Portable.NET...

     solely. The Oxygene compiler has been incorporated into a new Delphi development solution owned by Embarcadero named Delphi Prism
    Delphi Prism
    Delphi Prism is a rapid application development tool for the Microsoft .NET Framework and Mono, developed by RemObjects Software and distributed by Embarcadero Technologies....

    , which plugs into Microsoft Visual Studio
    Microsoft Visual Studio
    Microsoft Visual Studio is an integrated development environment from Microsoft. It is used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all...

    .

  • The Morfik Pascal
    Morfik
    Morfik Technology Pty Ltd., an Australian company, is the developer of Morfik, a set of visual designers, compilers and a Framework combined in an Integrated development environment aimed at developing Ajax applications in a high-level language such as Java, C#, BASIC or Object Pascal. Morfik...

     programming language developed by Morfik
    Morfik
    Morfik Technology Pty Ltd., an Australian company, is the developer of Morfik, a set of visual designers, compilers and a Framework combined in an Integrated development environment aimed at developing Ajax applications in a high-level language such as Java, C#, BASIC or Object Pascal. Morfik...

     targets the Ajax-enabled Web applications. The Morfik compiler is incorporated into the company's AppsBuilder IDE and allows Object Pascal code to be used in implementing code that will execute both in the browser and on the server. It uses the Free Pascal
    Free Pascal
    Free Pascal Compiler is a free Pascal and Object Pascal compiler.In addition to its own Object Pascal dialect, Free Pascal supports, to varying degrees, the dialects of several other compilers, including those of Turbo Pascal, Delphi, and some historical Macintosh compilers...

     compiler to generate native binaries from Object Pascal.

  • The open source
    Open source
    The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

     Free Pascal
    Free Pascal
    Free Pascal Compiler is a free Pascal and Object Pascal compiler.In addition to its own Object Pascal dialect, Free Pascal supports, to varying degrees, the dialects of several other compilers, including those of Turbo Pascal, Delphi, and some historical Macintosh compilers...

     project allows the language to be compiled for a wide range of operating systems—including Linux
    Linux
    Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

     (32-bit and 64-bit), FreeBSD
    FreeBSD
    FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...

    , Mac OS
    Mac OS
    Mac OS is a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

    /Mac OS X
    Mac OS X
    Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

    , Solaris, Win32, Win64 and Windows CE
    Windows CE
    Microsoft Windows CE is an operating system developed by Microsoft for embedded systems. Windows CE is a distinct operating system and kernel, rather than a trimmed-down version of desktop Windows...

    —as well as for several different hardware architectures. The first version of Free Pascal for the iPhone SDK
    Software development kit
    A software development kit is typically a set of software development tools that allows for the creation of applications for a certain software package, software framework, hardware platform, computer system, video game console, operating system, or similar platform.It may be something as simple...

     2.x was announced on January 17, 2009. Now there is also support for embedded (ARM).

  • MIDletPascal
    MIDletPascal
    MIDletPascal is an Pascal compiler and IDE specifically designed to create software for mobiles. It generates Java bytecode that runs on any Java ME device. In September 2009, Niksa Orlic, who wrote MIDlet pascal, transmitted the source code to the Russian Boolean.name development community for...

     is aimed at the Java byte-code platform.

  • The open source GNU Pascal
    GNU Pascal
    GNU Pascal is a Pascal compiler composed of a frontend to GNU Compiler Collection , similar to the way Fortran and other languages were added to GCC...

     compiler is available as a front-end to the GNU
    GNU
    GNU is a Unix-like computer operating system developed by the GNU project, ultimately aiming to be a "complete Unix-compatible software system"...

     compiler collection
    GNU Compiler Collection
    The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain...

    , which implements the ISO 7185 Pascal standard, and "most" of the ISO 10206 Extended Pascal standard.

  • Also, a free compiler, Turbo51, is available for producing code for Intel 8051
    Intel 8051
    The Intel MCS-51 is a Harvard architecture, single chip microcontroller series which was developed by Intel in 1980 for use in embedded systems. Intel's original versions were popular in the 1980s and early 1990s. While Intel no longer manufactures the MCS-51, binary compatible derivatives remain...

     chips.
  • WDSibyl is an open source Delphi-like IDE and compiler available for Microsoft Windows
    Microsoft Windows
    Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

     and OS/2
    OS/2
    OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

    , and is a commercial Borland Pascal compatible environment released by a company called Speedsoft that was later developed into a Delphi like RAD
    RAD
    Rad may mean:* Rad , a villainous character in AC Comics's "Femforce"* Rad , a 1986 release about a young BMX rider* Rad , several fictional characters in the Transformers toy line...

     environment called Sybil and then open sourced under the GPL when that company closed down. Wolfgang Draxler (WD) now maintains the software. (The compiler used seems to be located in a DLL and is not open-source).

Compilers

Object Pascal compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

s are available for a wide range of operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s and archtectures.
  • Embarcadero Delphi (formerly CodeGear Delphi and Borland Delphi) is probably the best known compiler. It is the successor of the highly successful Borland Pascal and Turbo Pascal
    Turbo Pascal
    Turbo Pascal is a software development system that includes a compiler and an integrated development environment for the Pascal programming language running on CP/M, CP/M-86, and DOS, developed by Borland under Philippe Kahn's leadership...

     product line. It targets Win16 (Delphi 1), Win32 (Delphi 2 and later), and the .NET 1.x, 2.0
    .NET Framework
    The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

     (Delphi 8, Delphi 2005–Delphi 2007). Support for .NET finally became a separate product known as Oxygene (see below).
  • Free Pascal
    Free Pascal
    Free Pascal Compiler is a free Pascal and Object Pascal compiler.In addition to its own Object Pascal dialect, Free Pascal supports, to varying degrees, the dialects of several other compilers, including those of Turbo Pascal, Delphi, and some historical Macintosh compilers...

     Compiler (FPC) is an open-source Object Pascal compiler that supports many Pascal dialects, including those of Turbo Pascal
    Turbo Pascal
    Turbo Pascal is a software development system that includes a compiler and an integrated development environment for the Pascal programming language running on CP/M, CP/M-86, and DOS, developed by Borland under Philippe Kahn's leadership...

     7 and Delphi, among others. Currently, FPC can generate code for x86, x86-64
    X86-64
    x86-64 is an extension of the x86 instruction set. It supports vastly larger virtual and physical address spaces than are possible on x86, thereby allowing programmers to conveniently work with much larger data sets. x86-64 also provides 64-bit general purpose registers and numerous other...

    , PowerPC
    PowerPC
    PowerPC is a RISC architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM...

    , SPARC
    SPARC
    SPARC is a RISC instruction set architecture developed by Sun Microsystems and introduced in mid-1987....

    , and ARM
    ARM architecture
    ARM is a 32-bit reduced instruction set computer instruction set architecture developed by ARM Holdings. It was named the Advanced RISC Machine, and before that, the Acorn RISC Machine. The ARM architecture is the most widely used 32-bit ISA in numbers produced...

     processors, and for various operating systems, including Microsoft Windows
    Microsoft Windows
    Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

    , Linux
    Linux
    Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

    , FreeBSD
    FreeBSD
    FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...

    , Mac OS
    Mac OS
    Mac OS is a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

     and Mac OS X
    Mac OS X
    Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

     (with an Xcode
    Xcode
    Xcode is a suite of tools, developed by Apple, for developing software for Mac OS X and iOS. Xcode 4.2, the latest major version, is available on the Mac App Store for free for Mac OS X 10.7 , and on the Apple Developer Connection website for free to registered developers Xcode is a suite of tools,...

     integration kit). Several separate projects exist to facilitate rapid application development with FPC, the most prominent one being the Lazarus
    Lazarus (software)
    Lazarus is a free cross-platform IDE which provides a Delphi-like development experience for Pascal and Object Pascal developers. It is developed for, and supported by, the Free Pascal compiler. Since early 2008, Lazarus has been available for Microsoft Windows, several Linux distributions,...

     IDE.
  • GNU Pascal
    GNU Pascal
    GNU Pascal is a Pascal compiler composed of a frontend to GNU Compiler Collection , similar to the way Fortran and other languages were added to GCC...

     (A separately-distributed part of the GNU Compiler Collection
    GNU Compiler Collection
    The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain...

    ) While not formally aimed at the Delphi dialect of Pascal, it does contain a Borland Pascal compatibility mode, and is very slowly incorporating a few Delphi language features. It is unsuitable for recompiling large bodies of Delphi code directly, but is noteworthy as having prolific support for operating systems and hardware architectures.
  • Oxygene (formerly known as Chrome) is an Object Pascal compiler from RemObjects Software
    RemObjects Software
    RemObjects Software is an American software company founded in 2002 by Alessandro Federici and Marc Hoffman. It develops and offers tools and libraries for software developers on a variety of development platforms, including Embarcadero Delphi, Microsoft .NET, Mono, and Apple's...

     that integrates into Microsoft Visual Studio
    Microsoft Visual Studio
    Microsoft Visual Studio is an integrated development environment from Microsoft. It is used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all...

    . It is also available as free command-line compiler that runs native on CLI
    Common Language Infrastructure
    The Common Language Infrastructure is an open specification developed by Microsoft and standardized by ISO and ECMA that describes the executable code and runtime environment that form the core of the Microsoft .NET Framework and the free and open source implementations Mono and Portable.NET...

    . It targets the .NET and Mono platforms.
  • MIDletPascal
    MIDletPascal
    MIDletPascal is an Pascal compiler and IDE specifically designed to create software for mobiles. It generates Java bytecode that runs on any Java ME device. In September 2009, Niksa Orlic, who wrote MIDlet pascal, transmitted the source code to the Russian Boolean.name development community for...

     is a mobile application development tool that generates Java ME bytecode.
  • PocketStudio
    PocketStudio
    PocketStudio by Winsoft is an IDE supporting rapid application development for Palm OS and related operating systems like Garnet OS or Access Linux Platform...

     is a Pascal based IDE
    Integrated development environment
    An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

     for Palm OS
    Palm OS
    Palm OS is a mobile operating system initially developed by Palm, Inc., for personal digital assistants in 1996. Palm OS is designed for ease of use with a touchscreen-based graphical user interface. It is provided with a suite of basic applications for personal information management...

    .

Legacy products

  • Borland Kylix was a Linux
    Linux
    Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

     variant of Delphi which only targets Intel 32-bit Linux using the Qt
    Qt (toolkit)
    Qt is a cross-platform application framework that is widely used for developing application software with a graphical user interface , and also used for developing non-GUI programs such as command-line tools and consoles for servers...

     library. It does not work out-of-the-box with most modern Linux distributions.
  • Virtual Pascal
    Virtual Pascal
    Virtual Pascal is a free 32-bit Pascal compiler, IDE, and debugger for OS/2 and Microsoft Windows, with some limited Linux support. Although it had a wide user base in the late 1990s, VP has not evolved significantly for several years, and the owner declared in 2005 that development had ceased...

     was a free 32-bit Turbo Pascal- and Delphi-compatible compiler aimed mainly at OS/2
    OS/2
    OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

     and Microsoft Windows, although it also developed a DOS+ Extender and an experimental Linux cross-compiler. The compiler’s development stopped at about the level of Delphi 2. In 2007, with its official website ceasing to operate, Virtual Pascal was discontinued from being further developed.
  • TMT Pascal ?

Interpreters

Pascal Script (formerly known as InnerFuse) and DWScript (Delphi Web Script) are open-source Object Pascal interpreters
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

/scripting engines written in Delphi. They support subsets of Object Pascal. DWScript can also compile Object Pascal code into JavaScript code.

Apple's Object Pascal


program ObjectPascalExample;

type
THelloWorld = object
procedure Put;
end;

var
HelloWorld: THelloWorld;

procedure THelloWorld.Put;
begin
WriteLn('Hello, World!');
end;

begin
New(HelloWorld);
HelloWorld.Put;
Dispose(HelloWorld);
end.

Turbo Pascal's Object Pascal

Still supported in Delphi and Free Pascal. FPC also packages its own substitutes for the libraries/units. Delphi doesn't. The Free Pascal 1.0 series and the FPC textmode IDE are the largest open codebases in this dialect. Free Pascal 2.0 was rewritten in a more Delphi-like dialect.


program ObjectPascalExample;

type
PHelloWorld = ^THelloWorld;
THelloWorld = object
procedure Put;
end;

var
HelloWorld: PHelloWorld; { this is a pointer to a THelloWorld }

procedure THelloWorld.Put;
begin
WriteLn('Hello, World!');
end;

begin
New(HelloWorld);
HelloWorld^.Put;
Dispose(HelloWorld);
end.

Delphi and Free Pascal's Object Pascal


program ObjectPascalExample;

type
THelloWorld = class
procedure Put;
end;

procedure THelloWorld.Put;
begin
Writeln('Hello, World!');
end;

var
HelloWorld: THelloWorld; { this is an implicit pointer }

begin
HelloWorld := THelloWorld.Create; { constructor returns a pointer to an object of type THelloWorld }
HelloWorld.Put;
HelloWorld.Free; { this line deallocates the THelloWorld object pointed to by HelloWorld }
end.

Note that the object construct is still available in Delphi and Free Pascal (Delphi-compatible mode).

Oxygene Object Pascal


namespace ObjectPascalExample;

interface

type
ConsoleApp = class
class method Main;
end;

THelloWorld = class
method Put;
end;

implementation

method THelloWorld.Put;
begin
Console.WriteLine('Hello, World!');
end;

class method ConsoleApp.Main;
begin
var HelloWorld := new THelloWorld;
HelloWorld.Put;
end;

end.

DWScript's Object Pascal


type
THelloWorld = class
procedure Put;
begin
PrintLn('Hello, World!');
end
end;

var HelloWorld := THelloWorld.Create;

HelloWorld.Put;

Note that the method implementation can also be made in a distinct location as in other Object Pascal dialects.

Development

Many features have been introduced continuously to Object Pascal with extensions to Delphi, now also by Free Pascal. In reaction to criticisms, Free Pascal has adopted generics, and both Delphi and Free Pascal now support operator overloading (with different grammar, though). Delphi has also introduced many other features since version 7 including generics.

See also

  • Borland Kylix
  • Comparison of programming languages
    Comparison of programming languages
    Programming languages are used for controlling the behavior of a machine . Like natural languages, programming languages conform to rules for syntax and semantics.There are thousands of programming languages and new ones are created every year...

  • Free Pascal
    Free Pascal
    Free Pascal Compiler is a free Pascal and Object Pascal compiler.In addition to its own Object Pascal dialect, Free Pascal supports, to varying degrees, the dialects of several other compilers, including those of Turbo Pascal, Delphi, and some historical Macintosh compilers...

  • Turbo51
    Turbo51
    Turbo51 is a compiler for the programming language Pascal, for the Intel MCS-51 family of microcontrollers. It features Borland Turbo Pascal 7 syntax, support for inline assembly code, source-level debugging, and optimizations, among others...

  • Hello world program
    Hello world program
    A "Hello world" program is a computer program that outputs "Hello world" on a display device. Because it is typically one of the simplest programs possible in most programming languages, it is by tradition often used to illustrate to beginners the most basic syntax of a programming language, or to...

  • NetBeans
    NetBeans
    NetBeans refers to both a platform framework for Java desktop applications, and an integrated development environment for developing with Java, JavaScript, PHP, Python, Groovy, C, C++, Scala, Clojure, and others...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK