ArticleslgStudy

computer science

Harbour (programming language)

Harbour (programming language) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Harbour (programming language) rather than just read about it. In short: 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.

Harbour (programming language) — main illustration
Harbour (programming language) — illustration

Key takeaways

  • Harbour (programming language) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Harbour (programming language) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Harbour (programming language) from memory before moving on to harder problems.

Reference excerpt

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.

Illustrations

Harbour (programming language): HBIDE look.
HBIDE look.

Worked examples

Example 1 — a first encounter with Harbour (programming language)

Start with the simplest possible case. Write down what Harbour (programming language) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Harbour (programming language) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Harbour (programming language) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Harbour (programming language)

In research
Harbour (programming language) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Harbour (programming language) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Harbour (programming language) is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1999 software, DOS software, Declarative programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for Harbour (programming language) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Harbour (programming language)” →

How to study Harbour (programming language) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Harbour (programming language) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Harbour (programming language) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Harbour (programming language) in simple terms?

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.

Why does Harbour (programming language) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Harbour (programming language)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Harbour (programming language).

Tags

  • 1999 software
  • DOS software
  • Declarative programming languages
  • Dynamic programming languages
  • Dynamically typed programming languages
  • Fourth-generation programming languages
  • Free software programmed in C
  • High-level programming languages
  • Linux programming tools
  • Multi-paradigm programming languages
  • Procedural programming languages
  • Programming languages created in 1999

Keep exploring