Harbour is a computer programming language, used mainly to create database/business programs. It is a modernised cross-platform version of the older Clipper system, which in turn developed from the dBase database market of the 1980s and 1990s. It is free and open-source software which license is GNU General Public License (GPL) compatible. Harbour code uses the same databases and can be compiled under a wide variety of platforms, including Windows, Linux, Unix variants, several Berkeley Software Distribution (BSD) descendants, macOS, Windows CE, Symbian, iOS, Android, VxWorks, OS/2 (including eComStation and ArcaOS), BeOS–Haiku, and AIX.
History The idea of a free software Clipper compiler had been arising for a long time and the subject occurred often in discussion on comp.lang.clipper. Antonio Linares founded the Harbour project and the implementation was started in March 1999. The name "Harbour" was proposed by Linares, it is a play on a Clipper as a type of ship. Harbour is a synonym for port (where ships dock), and Harbour is a port of the Clipper language. In 2009, Harbour was substantially redesigned, mainly by Viktor Szakáts and Przemyslaw Czerpak.
Database support Harbour extends the Clipper Replaceable Database Drivers (RDD) approach. It offers multiple RDDs such as dBase (DBF), DBFNTX, DBFCDX, DBFDBT and DBFFPT. In Harbour, multiple RDDs can be used in one application, and new logical RDDs can be defined by combining other RDDs. The RDD architecture allows for inheritance, so that a given RDD may extend the functions of other existing RDD(s). Third-party RDDs, like RDDSQL, RDDSIX, RMDBFCDX, Advantage Database Server, and Mediator exemplify some of the RDD architecture features. DBFNTX implementation has almost the same functionality of DBFCDX and RDDSIX. NETIO and LetoDB provide remote access over Transmission Control Protocol (TCP). Harbour also offers ODBC support by means of an object-oriented programming (OOP) syntax, and ActiveX Data Objects (ADO) support by means of OLE Automation (OLE). MySQL, PostgreSQL, SQLite, Firebird, Oracle are examples of databases which Harbour can connect to. xBase technologies are confused often with relational database management system (RDBMS) software. While xBase was promoted as relational, xBase is more than a simple database system, as at the same time, xBase languages using purely DBF cannot provide the full features of a full RDBMS.
Programming philosophy Harbour aims to be written once, compiled anywhere. As the same compiler is available for all of the above operating systems, there is no need for re-coding to produce identical products for different platforms, except when operating system dependent features are used. Cross-compiling is supported with MinGW. Under Microsoft Windows, Harbour is more stable but less well-documented than Clipper, but has multi-platform ability and is more transparent, allows for more customisation and can run from a USB flash drive. Under Linux and Windows Mobile, Clipper source code can be compiled with Harbour with very little adaptation. Most software originally written to run on Xbase++, FlagShip, FoxPro, xHarbour and others dialects can be compiled with Harbor with some adaptation. As of 2010 many efforts have been made to make the transition from other xBase dialects easier. Harbour can use the following C compilers, among others: GCC, MinGW, Clang, Intel C++ Compiler (ICC), Microsoft Visual C++ (6.0+), Borland C++, Watcom C, Pelles C and Sun Studio. Harbour can make use of multiple Graphical Terminal emulation, including console drivers, and Hybrid Console/GUIs, such as GTWvt, and GTWvg. Harbour supports external GUI's, free (e.g. HBQt, HWGui, Mini-GUI (latest version based on Qt and QtContribs) and commercial (e.g. FiveWin, Xailer). HBQt is a library providing bindings to Qt. HBIDE application is a sample of HBQt potential. Harbour is 100% Clipper-compatible and supports many language syntax extensions including greatly extended run-time libraries such as OLE, Blat, OpenSSL, Free Image, GD, hbtip, hbtpathy, PCRE, hbmzip (zlib), hbbz2 (bzip2), cURL, Cairo, its own implementation of CA-Tools, updated NanFor libraries and many others. Harbour has an active development community and extensive third party support.
Macro operator (runtime compiler) One of the most powerful features of xBase languages is the Macro Operator '&'. Harbour's implementation of the Macro Operator allows for runtime compilation of any valid Harbour expression. Such a compiled expression may be used as a VALUE, i.e. the right side of an assignment (rvalue) or may be used to resolve the left side (lvalue) of an assignment, i.e. private, or public variables, or a database field. Additionally, the Macro Operator may compile and execute function calls, complete assignments, or even list of arguments, and the result may be used to resolve any of the above contexts in the compiled application. The latest Macro compiler can compile any valid Harbour code including code to per-process before compile. Syntax:
&( ... )
The text value of the expression '...' will be compiled, and the value resulting from the execution of the compiled code is the result.
&SomeId
is the short form for &( SomeId ).
&SomeId.postfix
is the short form of &( SomeId + "postfix" ).
Object-oriented programming Programming in an OOP style is a broader issue than a specific library or a specific interface, but OOP programming is something many Clipper programmers have come to expect. CA-Clipper 5.2 and especially 5.3 added a number of base classes, and a matching OOP syntax. Libraries such as Class(y), FieWin, Clip4Win, and Top Class provide additional OOP functionality. Harbour has OOP extensions with full support for classes including inheritance, based on Class(y) syntax. OOP syntax in Harbour is very similar to that of earlier Clipper class libraries so it should be possible to maintain legacy Clipper code with minimal changes.
Syntax and semantics
Harbour as every xBase language is case insensitive and can optionally accept keywords written just by their first four characters.
… excerpt ends here. Continue reading the full article.

