Harbour (programming language): Difference between revisions

Content deleted Content added
Line 39:
In 2009 Harbour was substantially redesigned, mainly by Viktor Szakáts and Przemyslaw Czerpak.
 
==Database Supportsupport==
 
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 a single 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 functionality 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<ref>{{cite web|url=https://sourceforge.net/projects/letodb |title=LetoDB |publisher=Sourceforge.net |access-date=2013-12-09}}</ref> provide remote access over [[Transmission Control Protocol|TCP]] protocol.
Line 47:
xBase technologies often are confused with [[RDBMS]] software. Although this is true, xBase is more than a simple database system as at the same time xBase languages using purely DBF can not provide the full concept of a real RDBMS.
 
==Programming Philosophyphilosophy==
Unlike Java which is intended to be written once, run anywhere, Harbour aims to be [[Write once, compile anywhere|written once, compiled anywhere]]. As the same compiler is available for all of the above operating systems, there is no need for recoding 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 capability and is more transparent, customizable and can run from a USB flash drive.
Line 100:
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 Semanticssemantics==
[[File:Harbour Sample Code.png|thumb|600px|Harbour code on HBIDE]]
 
Line 187:
The condition expression(s) has to evaluate to a ''LOGICAL'' value.
 
====SWITCH Statementsstatements====
Harbour supports a SWITCH construct inspired by the C implementation of switch().
 
Line 204:
* The ''EXIT'' optional statement is the equivalent of the C statement ''break'', and if present, execution of the SWITCH structure will end when the EXIT statement is reached, otherwise it will continue with the first statement below the next CASE statement (fall through).
 
====BEGIN SEQUENCE Statementsstatements====
BEGIN SEQUENCE
''...''
Line 227:
Alternatively TRY [CATCH] [FINALLY] statements are available on ''xhb'' library working like the SEQUENCE construct.
 
===Procedures and Functionsfunctions===
[STATIC] PROCEDURE ''SomeProcedureName''
[STATIC] PROCEDURE ''SomeProcedureName''()
Line 258:
</syntaxhighlight>
 
===Sample Codecode===
The typical "[[hello world]]" program would be:
<syntaxhighlight lang="visualfoxpro">
Line 281:
</syntaxhighlight>
 
====OOP Examplesexamples====
Main procedure:
<syntaxhighlight lang="vfp">
Line 356:
As of 2015 Harbour development is active and vibrant.
 
==xHarbour Comparisoncomparison==
[[xHarbour]] is a fork<ref>{{cite web|url=http://www.xharbour.org/index.asp?page=about/index |title=About xHarbour |publisher=Xharbour.org |access-date=2013-12-09}}</ref> of the earlier Harbour project. xHarbour takes a more aggressive approach to implementing new features in the language, while Harbour is more conservative in its approach, aiming first of all for an exact replication of Clipper behaviour and then implementing new features and extensions as a secondary consideration. It should also be noted that Harbour is supported on a wide variety of [[operating systems]] while xHarbour only really supports MS Windows and Linux 32-bit.
 
Line 365:
A detailed comparison between extensions implemented in Harbour and xHarbour can be found in the source repository of the project on GitHub.<ref>{{cite web|url=https://github.com/harbour/core/raw/master/doc/xhb-diff.txt |title=xhb-diff.txt |website=[[GitHub]] |access-date=2013-12-09}}</ref>
 
==GUI Librarieslibraries and Toolstools==
* '''[https://sourceforge.net/projects/qtcontribs/ hbide]''' – [[Integrated Development Environment]] to help Harbour development and various xBase dialects
* '''[https://ptsource.github.io/Developer-Platform/ PTSource IDE]''' – [[Integrated Development Environment]] includes Harbour
Line 374:
* '''[http://marinas-gui.org/ Marinas-GUI]''' – Multi-Platform QT Based GUI Development Package for Harbour. Marinas-GUI downloads as a complete installation package for the chosen target platform (IDE, Version Control, Harbour/C Compiler, Libraries etc.) – Basically install and start coding and compiling
 
== See Alsoalso ==
* [[Visual FoxPro]]
* [[Visual Objects]]
Line 383:
{{Reflist}}
 
== External Linkslinks ==
* {{official website|https://harbour.github.io}}
* [https://harbour.github.io/the-oasis/ The Oasis] Clipper, FoxPro and Xbase++ community repository