Content deleted Content added
m I have made some important changes like the spelling errors and remove likes which pages are not available. |
Jerryobject (talk | contribs) →Database support: WP:LINKs: update-standardizes, needless-WP:PIPEs > WP:NOPIPEs, adds. MOS:FIRSTABBReviations clarify, define before parenthetic WP:ABBRs. Small WP:COPYEDITs WP:EoS: WP:TERSE, clarify. |
||
(20 intermediate revisions by 15 users not shown) | |||
Line 1:
{{
{{
{{
{{
}}
{{Use dmy dates|date=June 2014}}
{{Infobox programming language
| name
| logo
| logo caption
| screenshot =
| paradigm = [[Multi-paradigm programming language|multi-paradigm]]: [[Imperative programming|imperative]], [[Functional programming|functional]], [[Object-oriented programming|object-oriented]], [[Reflective programming|reflective]]▼
| screenshot caption =
| year = {{Start date and age|1999}}▼
▲| paradigm
| designer = Antonio Linares▼
| family = [[xBase]]
| developer = Viktor Szakáts and community▼
| latest_release_date = {{Start date and age|df=yes|2011|07|17}}▼
| latest_preview_version = [https://sourceforge.net/projects/harbour-project/files/binaries-windows/nightly/ 3.2.0dev]▼
| latest release version = 3.0.0
| typing = Optionally [[duck typing|duck]], [[dynamic typing|dynamic]], [[type safety|safe]], partially [[strong typing|strong]]▼
| implementations =▼
▲|
| dialects = Clipper, Xbase++, FlagShip, FoxPro, xHarbour▼
▲| typing
| influenced = [[xHarbour]]▼
| operating system = [[Cross-platform software|Cross-platform]]
| license
| website
|
| wikibooks
| influenced by = [[dBase]], [[Clipper (programming language)|Clipper]]
}}
'''Harbour''' is a computer [[programming language]],
Harbour code
==
The idea of a free software Clipper compiler had been
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 [[
Harbour also offers [[ODBC]] support by means of an [[
▲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.
[[xBase]] technologies
▲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 (database server)|Firebird]], [[Oracle (database)|Oracle]] are examples of databases which Harbour can connect to.
▲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 philosophy==
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.
Line 57 ⟶ 56:
[[MinGW]],
[[Clang]],
[[Intel C++ Compiler
[[Microsoft Visual C++]] (6.0+),
[[Borland C++]],
Line 66 ⟶ 65:
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<ref>{{cite web |title=QtContribs - Harbour Qt Projects |url=https://sourceforge.net/projects/qtcontribs/ |website=SourceForge |date=6 July 2023 |language=en}}</ref>) 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<ref>{{cite web|url=https://harbour.github.io/ |title=Official Harbour page |publisher=The Harbour Project |access-date=2013-12-09}}</ref> and supports many language syntax extensions including greatly extended run-time libraries such as [[OLE Automation|OLE]], Blat, [[OpenSSL]], Free Image, [[GD Graphics Library|GD]], hbtip, hbtpathy, [[PCRE]], hbmzip ([[zlib]]), hbbz2 ([[bzip2]]), [[cURL]], [[Cairo (graphics)|Cairo]], its own implementation of CA-Tools, updated NanFor libraries and many others. Harbour has an active development community and extensive third party support.
Line 72 ⟶ 71:
Any [[xBase]] language provides a very productive way to build business and data intensive applications. Harbour is not an exception.
===Macro
One of the most powerful features of xBase languages is the [[Macro (computer science)|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)
▲One of the most powerful features of xBase languages is the [[Macro (computer science)|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), but such a compiled expression 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
The latest Macro compiler can compile any valid Harbour code including code to per-process before compile.
Line 94 ⟶ 92:
is the short form of &( SomeId + "postfix" ).
===Object-oriented
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 [https://web.archive.org/web/20010501165630/http://appsolutions.com/Classy/ 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
[[File:Harbour Sample Code.png|thumb|600px|Harbour code on HBIDE]]
Line 106 ⟶ 103:
===Built-in data types===
Harbour has six scalar types
Literal (static) representation of scalar types:
Line 116 ⟶ 113:
Complex Types may also be represent as literal values:
* Array: <syntaxhighlight lang=
* [[CodeBlock]]: <syntaxhighlight lang=
* Hash: <syntaxhighlight lang=
Hashes may use ''any'' type including other Hashes as the ''Key'' for any element. Hashes and Arrays may contain ''any'' type as the ''Value'' of any member, including nesting arrays, and Hashes.
Codeblocks may have references to Variables of the Procedure/Function>method in which it was defined. Such Codeblocks may be returned as a value, or by means of an argument passed {{
Detached variables will maintain their value for as long as a Codeblock referencing them still exists. Such values will be shared with any other Codeblock which may have access to those same variables. If the Codeblock did not outlive its containing routine, and will be evaluated within the lifetime of the routine in which it is defined, changes to its ''Detached Variables''(s) by means of its evaluation, will be reflected back at its parent routine.
Codeblocks can be evaluated any number of times, by means of the {{
===Variables===
Line 132 ⟶ 129:
'''Variables have one of the following scopes:'''
* {{
* {{
* {{
* {{
{{
Due to the dynamic nature of {{
=== Control
The basic control structures include all of the standard [[dBase]], and [[Clipper (programming language)|Clipper]] control structures as well as additional ones inspired by the [[C (programming language)|C]] or [[Java (programming language)|Java]] programming languages:
Line 187 ⟶ 184:
The condition expression(s) has to evaluate to a ''LOGICAL'' value.
====SWITCH
Harbour supports a SWITCH construct inspired by the C implementation of switch().
Line 204 ⟶ 201:
* 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
BEGIN SEQUENCE
''...''
Line 227 ⟶ 224:
Alternatively TRY [CATCH] [FINALLY] statements are available on ''xhb'' library working like the SEQUENCE construct.
===Procedures and
[STATIC] PROCEDURE ''SomeProcedureName''
[STATIC] PROCEDURE ''SomeProcedureName''()
Line 239 ⟶ 236:
[STATIC] FUNCTION ''SomeProcedureName''( ''Param1'' [, ''ParamsN''] )
[[Subroutine|Procedures]] and [[
The ''INIT'' or ''EXIT'' optional qualifiers, will flag the procedure to be automatically invoked just before calling the application startup procedure, or just after quitting the application, respectively. [[Parameter (computer science)|Parameter]]s passed to a procedure/function appear in the subroutine as local variables, and may accept any type, including references.
Line 251 ⟶ 248:
An example procedure definition and a function call follows:
<syntaxhighlight lang="
x := Cube( 2 )
Line 258 ⟶ 255:
</syntaxhighlight>
===Sample
The typical "[["Hello, World!" program|hello world]]" program would be:
<syntaxhighlight lang="
? "Hello, world!"
</syntaxhighlight>
Or:
<syntaxhighlight lang="
QOut( "Hello, world!" )
</syntaxhighlight>
Or:
<syntaxhighlight lang="
Alert( "Hello, world!" )
</syntaxhighlight>
Or, enclosed in an explicit procedure:
<syntaxhighlight lang="
PROCEDURE Main()
Line 281 ⟶ 278:
</syntaxhighlight>
====OOP
Main procedure:
<syntaxhighlight lang="vfp">
Line 346 ⟶ 343:
* hbrun – Shell interpreter for Harbour. Macro compiling allows to run any valid Harbour code as it's being compiled
* hbformat – Formats source code written on Harbour or another dialect according to defined rules
* hbpp – Pre-processor, a powerful tool which avoids typical problems found on C language
* hbi18n – Tools to localizing text on applications
* hbdoc – Creates documentation for Harbour
All tools are
==Development==
[[File:HBIDE Editor.png|thumb|400px|HBIDE look.]]
Today Harbour development is led by Viktor Szakáts in collaboration with Przemysław Czerpak who also contributes many components of the core language and supplementary components. HBIDE and some other components, especially HBQt, are developed by Pritpal Bedi. Other members of the development community send changes to the [[GitHub]] source repository.<ref>{{cite web|url=https://github.com/harbour |title=harbour 路 GitHub |publisher=Github.com |access-date=2013-12-09}}</ref>
As of 2015 Harbour development is active and vibrant.
==xHarbour comparison==
The Harbour developers have attempted to document all hidden behaviour in the Clipper language and test Harbour-compiled code alongside the same code compiled with Clipper to maintain compatibility.
Line 366 ⟶ 364:
==GUI libraries and tools==
*
*
*
*
*
*
*
==
* [[Visual FoxPro]]
* [[Visual Objects]]
* [[XBase
* [[PWCT]] free open source visual programming language support Harbour through [[PWCT#Visual
==References==
{{Reflist}}
==
* {{
* [https://harbour.github.io/the-oasis/ The Oasis] Clipper, FoxPro and Xbase++ community repository
* [http://hbide.vouch.info/ HBIDE]
Line 390 ⟶ 388:
* [https://groups.google.com/group/harbour-users/ Harbour Users Mailing List]
* [http://www.kresin.ru/en/harbour.html Extensive Harbour documentation, libraries, tools site]
*
{{xBase}}
Line 411 ⟶ 409:
[[Category:Free software programmed in C]]
[[Category:Multi-paradigm programming languages]]
[[Category:Table-oriented programming]]
<!-- Hidden categories below -->
[[Category:Articles with example code]]
|