Harbour Copying

THE HARBOUR PROJECT COMPILER LICENSE
====================================
Note: This license applies to most of the files in the src/compiler
 and utils/hbmk2 directories and certain .hb Harbour scripts.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
their web site at http://www.gnu.org/).

THE HARBOUR PROJECT LIBRARY LICENSE
===================================
Note: This license applies to most of the files in the include directory,
 source directory, and subdirectories.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this software; see the file COPYING.txt. If not, write to
the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
As a special exception, the Harbour Project gives permission for
additional uses of the text contained in its release of Harbour.
The exception is that, if you link the Harbour libraries with other
files to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public License.
Your use of that executable is in no way restricted on account of
linking the Harbour library code into it.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License.
This exception applies only to the code released by the Harbour
Project under the name Harbour. If you copy code from other
Harbour Project or Free Software Foundation releases into a copy of
Harbour, as the General Public License permits, the exception does
not apply to the code that you add in this way. To avoid misleading
anyone as to the status of such modified files, you must delete
this exception notice from them.
If you write modifications of your own for Harbour, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.

THE HARBOUR PROJECT CONTRIB LICENSE
===================================
There is no one single license that applies to the Harbour Project
contrib files. Some files use the Harbour Project Compiler license.
Some files use the Harbour Project Library license. Some files use
the old Harbour Project Library license. Some files may even use other
types of free software or open source software licenses. Some files
have been donated to the public domain. If you use any of the contrib
files, you need to investigate the license that applies to each file.

THE HARBOUR PROJECT NON-SOURCE LICENSE
======================================
Note: This license applies to the files where the content
 explicitly indicates so.
These works are licensed under the Creative Commons Attribution-ShareAlike
 License. To view a copy of this license, visit
 http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to
 Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305,
 USA. A summary of the license and the full legal text is included
 after this text. If you wish to distribute some or all of these works
 under different terms, please contact respective author(s).
License summary: Creative Commons Attribution-ShareAlike 3.0 Unported
-*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*-
You are free:
* to Share - to copy, distribute and transmit the work
 * to Remix - to adapt the work
Under the following conditions:
* Attribution. You must attribute the work in the manner specified
 by the author or licensor (but not in any way that suggests that
 they endorse you or your use of the work).
* Share Alike. If you alter, transform, or build upon this work,
 you may distribute the resulting work only under the same,
 similar or a compatible license.
* For any reuse or distribution, you must make clear to others the
 license terms of this work. The best way to do this is with a
 link to this web page.
* Any of the above conditions can be waived if you get permission
 from the copyright holder.
* Nothing in this license impairs or restricts the author's moral
 rights.
-*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*-
Creative Commons Legal Code: Attribution-ShareAlike 3.0 Unported
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
DAMAGES RESULTING FROM ITS USE.
License:
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS
CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS
PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE
WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS
PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND
AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS
LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU
THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH
TERMS AND CONDITIONS.
1. Definitions
a. "Adaptation" means a work based upon the Work, or upon the Work
 and other pre-existing works, such as a translation, adaptation,
 derivative work, arrangement of music or other alterations of a
 literary or artistic work, or phonogram or performance and
 includes cinematographic adaptations or any other form in which
 the Work may be recast, transformed, or adapted including in any
 form recognizably derived from the original, except that a work
 that constitutes a Collection will not be considered an
 Adaptation for the purpose of this License. For the avoidance of
 doubt, where the Work is a musical work, performance or
 phonogram, the synchronization of the Work in timed-relation
 with a moving image ("synching") will be considered an
 Adaptation for the purpose of this License.
b. "Collection" means a collection of literary or artistic works,
 such as encyclopedias and anthologies, or performances,
 phonograms or broadcasts, or other works or subject matter other
 than works listed in Section 1(f) below, which, by reason of the
 selection and arrangement of their contents, constitute
 intellectual creations, in which the Work is included in its
 entirety in unmodified form along with one or more other
 contributions, each constituting separate and independent works
 in themselves, which together are assembled into a collective
 whole. A work that constitutes a Collection will not be
 considered an Adaptation (as defined below) for the purposes of
 this License.
c. "Creative Commons Compatible License" means a license that is
 listed at http://creativecommons.org/compatiblelicenses that has
 been approved by Creative Commons as being essentially
 equivalent to this License, including, at a minimum, because
 that license: (i) contains terms that have the same purpose,
 meaning and effect as the License Elements of this License; and,
 (ii) explicitly permits the relicensing of adaptations of works
 made available under that license under this License or a
 Creative Commons jurisdiction license with the same License
 Elements as this License.
d. "Distribute" means to make available to the public the original
 and copies of the Work or Adaptation, as appropriate, through
 sale or other transfer of ownership.
e. "License Elements" means the following high-level license
 attributes as selected by Licensor and indicated in the title of
 this License: Attribution, ShareAlike.
f. "Licensor" means the individual, individuals, entity or entities
 that offer(s) the Work under the terms of this License.
g. "Original Author" means, in the case of a literary or artistic
 work, the individual, individuals, entity or entities who
 created the Work or if no individual or entity can be
 identified, the publisher; and in addition (i) in the case of a
 performance the actors, singers, musicians, dancers, and other
 persons who act, sing, deliver, declaim, play in, interpret or
 otherwise perform literary or artistic works or expressions of
 folklore; (ii) in the case of a phonogram the producer being the
 person or legal entity who first fixes the sounds of a
 performance or other sounds; and, (iii) in the case of
 broadcasts, the organization that transmits the broadcast.
h. "Work" means the literary and/or artistic work offered under the
 terms of this License including without limitation any
 production in the literary, scientific and artistic domain,
 whatever may be the mode or form of its expression including
 digital form, such as a book, pamphlet and other writing; a
 lecture, address, sermon or other work of the same nature; a
 dramatic or dramatico-musical work; a choreographic work or
 entertainment in dumb show; a musical composition with or
 without words; a cinematographic work to which are assimilated
 works expressed by a process analogous to cinematography; a work
 of drawing, painting, architecture, sculpture, engraving or
 lithography; a photographic work to which are assimilated works
 expressed by a process analogous to photography; a work of
 applied art; an illustration, map, plan, sketch or
 three-dimensional work relative to geography, topography,
 architecture or science; a performance; a broadcast; a
 phonogram; a compilation of data to the extent it is protected
 as a copyrightable work; or a work performed by a variety or
 circus performer to the extent it is not otherwise considered a
 literary or artistic work.
i. "You" means an individual or entity exercising rights under this
 License who has not previously violated the terms of this
 License with respect to the Work, or who has received express
 permission from the Licensor to exercise rights under this
 License despite a previous violation.
j. "Publicly Perform" means to perform public recitations of the
 Work and to communicate to the public those public recitations,
 by any means or process, including by wire or wireless means or
 public digital performances; to make available to the public
 Works in such a way that members of the public may access these
 Works from a place and at a place individually chosen by them;
 to perform the Work to the public by any means or process and
 the communication to the public of the performances of the Work,
 including by public digital performance; to broadcast and
 rebroadcast the Work by any means including signs, sounds or
 images.
k. "Reproduce" means to make copies of the Work by any means
 including without limitation by sound or visual recordings and
 the right of fixation and reproducing fixations of the Work,
 including storage of a protected performance or phonogram in
 digital form or other electronic medium.
2. Fair Dealing Rights.
Nothing in this License is intended to reduce, limit, or restrict
 any uses free from copyright or rights arising from limitations or
 exceptions that are provided for in connection with the copyright
 protection under copyright law or other applicable laws.
3. License Grant.
Subject to the terms and conditions of this License, Licensor
 hereby grants You a worldwide, royalty-free, non-exclusive,
 perpetual (for the duration of the applicable copyright) license to
 exercise the rights in the Work as stated below:
a. to Reproduce the Work, to incorporate the Work into one or more
 Collections, and to Reproduce the Work as incorporated in the
 Collections;
b. to create and Reproduce Adaptations provided that any such
 Adaptation, including any translation in any medium, takes
 reasonable steps to clearly label, demarcate or otherwise
 identify that changes were made to the original Work. For
 example, a translation could be marked "The original work was
 translated from English to Spanish," or a modification could
 indicate "The original work has been modified.";
c. to Distribute and Publicly Perform the Work including as
 incorporated in Collections; and,
d. to Distribute and Publicly Perform Adaptations.
e. For the avoidance of doubt:
i. Non-waivable Compulsory License Schemes. In those
 jurisdictions in which the right to collect royalties
 through any statutory or compulsory licensing scheme
 cannot be waived, the Licensor reserves the exclusive
 right to collect such royalties for any exercise by You of
 the rights granted under this License;
ii. Waivable Compulsory License Schemes. In those
 jurisdictions in which the right to collect royalties
 through any statutory or compulsory licensing scheme can
 be waived, the Licensor waives the exclusive right to
 collect such royalties for any exercise by You of the
 rights granted under this License; and,
iii. Voluntary License Schemes. The Licensor waives the right
 to collect royalties, whether individually or, in the
 event that the Licensor is a member of a collecting
 society that administers voluntary licensing schemes, via
 that society, from any exercise by You of the rights
 granted under this License.
The above rights may be exercised in all media and formats whether
 now known or hereafter devised. The above rights include the right
 to make such modifications as are technically necessary to exercise
 the rights in other media and formats. Subject to Section 8(f), all
 rights not expressly granted by Licensor are hereby reserved.
4. Restrictions.
The license granted in Section 3 above is expressly made subject to
 and limited by the following restrictions:
a. You may Distribute or Publicly Perform the Work only under the
 terms of this License. You must include a copy of, or the
 Uniform Resource Identifier (URI) for, this License with every
 copy of the Work You Distribute or Publicly Perform. You may not
 offer or impose any terms on the Work that restrict the terms of
 this License or the ability of the recipient of the Work to
 exercise the rights granted to that recipient under the terms of
 the License. You may not sublicense the Work. You must keep
 intact all notices that refer to this License and to the
 disclaimer of warranties with every copy of the Work You
 Distribute or Publicly Perform. When You Distribute or Publicly
 Perform the Work, You may not impose any effective technological
 measures on the Work that restrict the ability of a recipient of
 the Work from You to exercise the rights granted to that
 recipient under the terms of the License. This Section 4(a)
 applies to the Work as incorporated in a Collection, but this
 does not require the Collection apart from the Work itself to be
 made subject to the terms of this License. If You create a
 Collection, upon notice from any Licensor You must, to the
 extent practicable, remove from the Collection any credit as
 required by Section 4(c), as requested. If You create an
 Adaptation, upon notice from any Licensor You must, to the
 extent practicable, remove from the Adaptation any credit as
 required by Section 4(c), as requested.
b. You may Distribute or Publicly Perform an Adaptation only under
 the terms of: (i) this License; (ii) a later version of this
 License with the same License Elements as this License; (iii) a
 Creative Commons jurisdiction license (either this or a later
 license version) that contains the same License Elements as this
 License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative
 Commons Compatible License. If you license the Adaptation under
 one of the licenses mentioned in (iv), you must comply with the
 terms of that license. If you license the Adaptation under the
 terms of any of the licenses mentioned in (i), (ii) or (iii)
 (the "Applicable License"), you must comply with the terms of
 the Applicable License generally and the following provisions:
 (I) You must include a copy of, or the URI for, the Applicable
 License with every copy of each Adaptation You Distribute or
 Publicly Perform; (II) You may not offer or impose any terms on
 the Adaptation that restrict the terms of the Applicable License
 or the ability of the recipient of the Adaptation to exercise
 the rights granted to that recipient under the terms of the
 Applicable License; (III) You must keep intact all notices that
 refer to the Applicable License and to the disclaimer of
 warranties with every copy of the Work as included in the
 Adaptation You Distribute or Publicly Perform; (IV) when You
 Distribute or Publicly Perform the Adaptation, You may not
 impose any effective technological measures on the Adaptation
 that restrict the ability of a recipient of the Adaptation from
 You to exercise the rights granted to that recipient under the
 terms of the Applicable License. This Section 4(b) applies to
 the Adaptation as incorporated in a Collection, but this does
 not require the Collection apart from the Adaptation itself to
 be made subject to the terms of the Applicable License.
c. If You Distribute, or Publicly Perform the Work or any
 Adaptations or Collections, You must, unless a request has been
 made pursuant to Section 4(a), keep intact all copyright notices
 for the Work and provide, reasonable to the medium or means You
 are utilizing: (i) the name of the Original Author (or
 pseudonym, if applicable) if supplied, and/or if the Original
 Author and/or Licensor designate another party or parties (e.g.,
 a sponsor institute, publishing entity, journal) for attribution
 ("Attribution Parties") in Licensor's copyright notice, terms of
 service or by other reasonable means, the name of such party or
 parties; (ii) the title of the Work if supplied; (iii) to the
 extent reasonably practicable, the URI, if any, that Licensor
 specifies to be associated with the Work, unless such URI does
 not refer to the copyright notice or licensing information for
 the Work; and (iv) , consistent with Ssection 3(b), in the case
 of an Adaptation, a credit identifying the use of the Work in
 the Adaptation (e.g., "French translation of the Work by
 Original Author," or "Screenplay based on original Work by
 Original Author"). The credit required by this Section 4(c) may
 be implemented in any reasonable manner; provided, however, that
 in the case of a Adaptation or Collection, at a minimum such
 credit will appear, if a credit for all contributing authors of
 the Adaptation or Collection appears, then as part of these
 credits and in a manner at least as prominent as the credits for
 the other contributing authors. For the avoidance of doubt, You
 may only use the credit required by this Section for the purpose
 of attribution in the manner set out above and, by exercising
 Your rights under this License, You may not implicitly or
 explicitly assert or imply any connection with, sponsorship or
 endorsement by the Original Author, Licensor and/or Attribution
 Parties, as appropriate, of You or Your use of the Work, without
 the separate, express prior written permission of the Original
 Author, Licensor and/or Attribution Parties.
d. Except as otherwise agreed in writing by the Licensor or as may
 be otherwise permitted by applicable law, if You Reproduce,
 Distribute or Publicly Perform the Work either by itself or as
 part of any Adaptations or Collections, You must not distort,
 mutilate, modify or take other derogatory action in relation to
 the Work which would be prejudicial to the Original Author's
 honor or reputation. Licensor agrees that in those jurisdictions
 (e.g. Japan), in which any exercise of the right granted in
 Section 3(b) of this License (the right to make Adaptations)
 would be deemed to be a distortion, mutilation, modification or
 other derogatory action prejudicial to the Original Author's
 honor and reputation, the Licensor will waive or not assert, as
 appropriate, this Section, to the fullest extent permitted by
 the applicable national law, to enable You to reasonably
 exercise Your right under Section 3(b) of this License (right to
 make Adaptations) but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING,
LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED,
STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF
TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE,
NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY,
OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT
DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED
WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability.
EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL
LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT
OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
a. This License and the rights granted hereunder will terminate
 automatically upon any breach by You of the terms of this
 License. Individuals or entities who have received Adaptations
 or Collections from You under this License, however, will not
 have their licenses terminated provided such individuals or
 entities remain in full compliance with those licenses. Sections
 1, 2, 5, 6, 7, and 8 will survive any termination of this
 License.
b. Subject to the above terms and conditions, the license granted
 here is perpetual (for the duration of the applicable copyright
 in the Work). Notwithstanding the above, Licensor reserves the
 right to release the Work under different license terms or to
 stop distributing the Work at any time; provided, however that
 any such election will not serve to withdraw this License (or
 any other license that has been, or is required to be, granted
 under the terms of this License), and this License will continue
 in full force and effect unless terminated as stated above.
8. Miscellaneous
a. Each time You Distribute or Publicly Perform the Work or a
 Collection, the Licensor offers to the recipient a license to
 the Work on the same terms and conditions as the license granted
 to You under this License.
b. Each time You Distribute or Publicly Perform an Adaptation,
 Licensor offers to the recipient a license to the original Work
 on the same terms and conditions as the license granted to You
 under this License.
c. If any provision of this License is invalid or unenforceable
 under applicable law, it shall not affect the validity or
 enforceability of the remainder of the terms of this License,
 and without further action by the parties to this agreement,
 such provision shall be reformed to the minimum extent necessary
 to make such provision valid and enforceable.
d. No term or provision of this License shall be deemed waived and
 no breach consented to unless such waiver or consent shall be in
 writing and signed by the party to be charged with such waiver
 or consent.
e. This License constitutes the entire agreement between the
 parties with respect to the Work licensed here. There are no
 understandings, agreements or representations with respect to
 the Work not specified here. Licensor shall not be bound by any
 additional provisions that may appear in any communication from
 You. This License may not be modified without the mutual written
 agreement of the Licensor and You.
f. The rights granted under, and the subject matter referenced, in
 this License were drafted utilizing the terminology of the Berne
 Convention for the Protection of Literary and Artistic Works (as
 amended on September 28, 1979), the Rome Convention of 1961, the
 WIPO Copyright Treaty of 1996, the WIPO Performances and
 Phonograms Treaty of 1996 and the Universal Copyright Convention
 (as revised on July 24, 1971). These rights and subject matter
 take effect in the relevant jurisdiction in which the License
 terms are sought to be enforced according to the corresponding
 provisions of the implementation of those treaty provisions in
 the applicable national law. If the standard suite of rights
 granted under applicable copyright law includes additional
 rights not granted under this License, such additional rights
 are deemed to be included in the License; this License is not
 intended to restrict the license of any rights under applicable
 law.
Creative Commons Notice
Creative Commons is not a party to this License, and makes no warranty
whatsoever in connection with the Work. Creative Commons will not be
liable to You or any party on any legal theory for any damages
whatsoever, including without limitation any general, special,
incidental or consequential damages arising in connection to this
license. Notwithstanding the foregoing two (2) sentences, if Creative
Commons has expressly identified itself as the Licensor hereunder, it
shall have all rights and obligations of Licensor.
Except for the limited purpose of indicating to the public that the
Work is licensed under the CCPL, Creative Commons does not authorize
the use by either party of the trademark "Creative Commons" or any
related trademark or logo of Creative Commons without the prior
written consent of Creative Commons. Any permitted use will be in
compliance with Creative Commons' then-current trademark usage
guidelines, as may be published on its website or otherwise made
available upon request from time to time. For the avoidance of doubt,
this trademark restriction does not form part of the License.
Creative Commons may be contacted at http://creativecommons.org/.

GNU GENERAL PUBLIC LICENSE VERSION 2
====================================
Binary tools included in Harbour source repository
all use GNU GPL 2. Find it below:
------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.

 GNU GENERAL PUBLIC LICENSE
 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
 stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
 whole or in part contains or is derived from the Program or any
 part thereof, to be licensed as a whole at no charge to all third
 parties under the terms of this License.
c) If the modified program normally reads commands interactively
 when run, you must cause it, when started running for such
 interactive use in the most ordinary way, to print or display an
 announcement including an appropriate copyright notice and a
 notice that there is no warranty (or else, saying that you provide
 a warranty) and that users may redistribute the program under
 these conditions, and telling the user how to view a copy of this
 License. (Exception: if the Program itself is interactive but
 does not normally print such an announcement, your work based on
 the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
 source code, which must be distributed under the terms of Sections
 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
 years, to give any third party, for a charge no more than your
 cost of physically performing source distribution, a complete
 machine-readable copy of the corresponding source code, to be
 distributed under the terms of Sections 1 and 2 above on a medium
 customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
 to distribute corresponding source code. (This alternative is
 allowed only for noncommercial distribution and only if you
 received the program in object code or executable form with such
 an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

 4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

 8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS

 Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
 Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.
You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
 This is free software, and you are welcome to redistribute it
 under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
 `Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989

 Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
File : Harbour\COPYING.TXT

What is Harbour ?

Harbour is a modern computer programming language. It is a Clipper-compatible compiler which is cross-platform, running on many operating systems (DOSMicrosoft WindowsLinuxUnix variants, several BSD descendants, Mac OS XMINIX 3Windows CEPocket PCSymbianiPhoneQNXVxWorksOS/2/eComStationBeOS/HaikuAIX) using the same source code and databases.

Although it is a powerful general-purpose programming language, it was primarily used to create database/business programs. Harbour have been actively maintained looking for diversity keeping backward-compatible with Clipper style. It has undergone many changes and revisions and regain widely popularity amongst programmers in 1980s and 1990s

The open source Harbour license is similar to the GNU General Public License, with an exception supporting proprietary applications, so proprietary applications can be produced with Harbour and distributed..

Paradigm(s) multi-paradigmimperativefunctional,object-orientedreflective
Appeared in 1999
Designed by Antonio Linares
Developer Viktor Szakáts and community
Stable release 3.0.0 (17 July 2011)
Preview release 3.1.x available from SVN
Typing discipline optionally duckdynamicsafe, partially strong
Dialects Clipper, Xbase ++, Flagship, FoxPro, xHarbour
Influenced by dBase, Clipper
Influenced xHarbour
OS Cross-platform
License Open source GPL Compatible
Usual filename extensions .prg, .ch, .hbs, .dbf
Website http://www.harbour-project.org/

History

The idea of a free software Clipper compiler has been floating around for a long time and the subject has often cropped up in discussion on comp.lang.clipper. Antonio Linares founded the Harbour project and the implementation was started.

Sailing the Clipper ship to a Harbour port. Clipper is a type of ship. Harbour is a synonym to port (where ship docks) Harbour is out port to the Clipper language.

On 2009 Harbour had a huge make over on its design promoted 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 DBF, DBFNTX, DBFCDX, DBFDBT and DBFFPT. In Harbour multiple RDDs can be used in a single application, and new logical RDDs can be defined from combination of 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 same functionality of DBFCDX and RDDSIX. NETIO and LetoDB provide remote access over TCP protocol Harbour also offers ODBC support by means of an OOP syntax, and ADO support by means of OLEMySQLPostgreSQLSQLiteFirebirdOracle are examples of databases which Harbour can connect.

xBase technologies often is confused with a RDBMS software. Although this is true, xBase is more than a simple database system as the same time xBase languages using purely DBF can not provide full concept of a real RDBMS

Programming philosophy

Unlike Java which is intended to be write once, run anywhere, Harbour aims to be write once, compile 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 MinGW32. 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.

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 2010 many efforts have been made to turn the transition from other xBase dialects easier.

Harbour can use the following C compilers, amongothers: GCCMinGWClangICCMicrosoft Visual C++ (6.0+), Borland C++Watcom CPelles C and Sun Studio.

Harbour can make use of multiple Graphic Terminal emulations, including console drivers, and Hybrid Console/GUIs, such as GTWvt, and GTWvg.

Harbour supports external GUIs, free (e.g. HWGui, MiniGUI and Qt) and commercial (e.g. FiveWin, Xailer). HBQt is a library provinding bindings to Qt. HBIDE application included in official distribution and SVN repository is a sample of HBQt potencial.

Harbour is 100% Clipper-compatible and supports many language syntax extensions including greatly extended run-time libraries such as OLE, BlatOpenSSLFreeImage,GD, TIP, Tpathy, PCRE, HbZip (zlib and bzip2), cURLCairo, its own implementation of CA-Tools and NanFor libraries and many others. Harbour has an active development community and extensive third party support.

Any xBase language provides a very productive way to build business and data intensive applications. Harbour is not an exception.

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), but more interestingly, 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 of the macro may be used to resolve any of the above contexts in the compiled application. In other words, any Harbour application may be extended and modified at runtime to compile and execute additional code on-demand.

Latest Macro compiler can compile any valid Harbour code including code to pre-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), Fivewin, Clip4Win, and TopClass 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 first four characters

Built-in data types

Harbour has 6 scalar types : NilStringDateLogical, NumberPointer, and 4 complex types: ArrayObjectCodeBlock, and Hash. A scalar holds a single value, such as a string, number, or reference to any other type. Arrays are ordered lists of scalars or complex types, indexed by number, starting at 1. Hashes, or associative arrays, are unordered collections of any type values indexed by their associated key, which may be of any scalar or complex type.

Literal (static) representation of scalar types:

  • Nil: NIL
  • String: “hello”, ‘hello’, [hello]
  • Date: 0d20100405
  • Logical: .T., .F.
  • Number: 1, 1.1, −1, 0xFF

Complex Types may also be represent as literal values:

  • Array: { “String””, 1, { “Nested Array” }, .T., FunctionCall(), @FunctionPointer() }
  • CodeBlock: { |Arg1, ArgN| Arg1 := ArgN + OuterVar + FunctionCall() }
  • Hash: { “Name” => “John”, 1 => “Numeric key”, { “Nested” => “Hash” } }

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 BY REFERENCE, in such case the Codeblock will “outlive” the routine in which it was defined, and any variables it references, will be a DETACHED variable.

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 Eval( BlockExp ) function.

Variables

All types can be assigned to named variables. Named variable identifiers are 1 to 63 characters long, start with [A-Z|_] and further consist of the characters [A-Z|0–9|_] up to a maximum of 63 characters. Named variables are not case sensitive.

Variables have one of the following scopes:

  • LOCAL: Visible only within the routine which declared it. Value is lost upon exit of the routine.
  • STATIC: Visible only within the routine which declared it. Value is preserved for subsequent invocations of the routine. If a STATIC variable is declared before any Procedure/Function/Method is defined, it has a MODULE scope, and is visible within any routine defined within that same source file, it will maintain its life for the duration of the application lifetime.
  • PRIVATE: Visible within the routine which declared it, and all routines called by that routine.
  • PUBLIC: Visible by all routines in the same application.

LOCAL and STATIC are resolved at compile time, and thus are much faster than PRIVATE and PUBLIC variables which are dynamic entities accessed by means of a runtime Symbol table. For this same reason, LOCAL and STATIC variables are not exposed to the Macro compiler, and any macro code which attempts to reference them will generate a runtime error.

Due to the dynamic nature of PRIVATE and PUBLIC variables, they can be created and destroyed at runtime, can be accessed and modified by means of runtime macros, and can be accessed and modified by Codeblocks created on the fly.

Control structures

The basic control structures include all of the standard dBase, and Clipper control structures as well as additional ones inspired by the C or Java programming languages:

Loops

[DO] WHILE ConditionExp
   ...
   [LOOP]
   [EXIT]
END[DO]

FOR Var := InitExp TO EndExp [STEP StepExp]
   ...
   [LOOP]
   [EXIT]
NEXT
FOR EACH Var IN CollectionExp
   ...
   [HB_EnumIndex()]
   [LOOP]
   [EXIT]
NEXT
  • The  is a sequence of one of more Harbour statements, and square bracketes [] denote optional syntax.
  • The HB_EnumIndex() may be optionally used to retrieve the current iteration index (1 based).
  • The LOOP statement restarts the current iteration of the enclosing loop structure, and if the enclosing loop is a FOR or FOR EACH loop, it increases the iterator, moving to the next iteration of the loop.
  • The EXIT statement immediately terminates execution of the enclosing loop structure.
  • The NEXT statement closes the control structure and moves to the next iteration of loop structure.

In the FOR statement, the assignment expression is evaluated prior to the first loop iteration. The TO expression is evaluated and compared against the value of the control variable, prior to each iteration, and the loop is terminated if it evaluates to a numeric value greater than the numeric value of the control variable. The optional STEP expression is evaluated after each iteration, prior to deciding whether to perform the next iteration.

In FOR EACH, the Var variable will have the value (scalar, or complex) of the respective element in the collection value. The collection expression, may be an Array (of any type or combinations of types), an Hash Table, or an Object type.

IF statements

IF CondExp
   ...
[ELSEIF] CondExp
   ...
[ELSE]
   ...
END[IF]

 represents 0 or more statement(s). The condition expression(s) has to evaluate to a LOGICAL value.

SWITCH statements

Harbour supports a SWITCH construct inspired by the C implementation of switch().

SWITCH SwitchExp
   CASE LiteralExp
      ...
      [EXIT]
   [CASE LiteralExp]
      ...
      [EXIT]

   [DEFAULT]
      ...
END
  • The LiteralExp must be a compiled time resolvable numeric expression, and may involve operators, as long as such operators involve compile time static value.
  • 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 statements

BEGIN SEQUENCE
   ...
   [BREAK]
   [Break([Exp])]
RECOVER [USING Var]
   ...
END[SEQUENCE]

or:

BEGIN SEQUENCE
   ...
   [BREAK]
   [Break()]
END[SEQUENCE]

The BEGIN SEQUENCE structure allows for a well behaved abortion of any sequence, even when crossing nested procedures/functions. This means that a called procedure/function, may issue a BREAK statement, or a Break() expression, to force unfolding of any nested procedure/functions, all the way back to the first outer BEGIN SEQUENCE structure, either after its respective END statement, or a RECOVER clause if present. The Break statement may optionally pass any type of expression, which may be accepted by the RECOVER statement to allow further recovery handing.

Additionally the Harbour Error Object supports canDefaultcanRetry and canSubstitute properties, which allows error handlers to perform some preparations, and then request a Retry Operation, a Resume, or return a Value to replace the expression triggering the error condition.

Alternatively TRY [CATCH] [FINALLY] statements are available on xHB library working like the SEQUENCE construct.

Procedures/Functions

[STATIC] PROCEDURE SomeProcedureName
[STATIC] PROCEDURE SomeProcedureName()
[STATIC] PROCEDURE SomeProcedureName( Param1' [, ParamsN] )
INIT PROCEDURE SomeProcedureName
EXIT PROCEDURE SomeProcedureName
[STATIC] FUNCTION SomeProcedureName
[STATIC] FUNCTION SomeProcedureName()
[STATIC] FUNCTION SomeProcedureName( Param1' [, ParamsN] )

Procedures/Functions in Harbour can be specified with the keywords PROCEDURE, or FUNCTION. Naming rules are same as those for Variables (up to 63 characters non case sensitive). Both Procedures and Functions may be qualified by the scope qualifier STATIC to restrict their usage to the scope of the module where defined.

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. Parameters passed to a procedure/function appear in the subroutine as local variables, and may accept any type, including references.

Changes to argument variables are not reflected in respective variables passed by the calling procedure/function/method unless explicitly passed BY REFERENCE using the@ prefix.

PROCEDURE have no return value, and if used in an Expression context will produce a NIL value.

FUNCTION may return any type by means of the RETURN statement, anywhere in the body of its definition.

An example procedure definition and a function call follows:

 x := Cube( 2 )

 FUNCTION Cube( n )
 RETURN n ** 3

 Sample code The typical “hello world” program would be:

 
  ? "Hello, world!"

Or:

  QOut( "Hello, world!" )

Or:

  Alert( "Hello, world!" )

Or, enclosed in an explicit procedure:

 PROCEDURE Main()

    ? "Hello, world!"

 RETURN

 

OOP examples

 #include "hbclass.ch"

 PROCEDURE Main()

    LOCAL oPerson := Person( "Dave" )

    oPerson:Eyes := "Invalid"

    oPerson:Eyes := "Blue"

    Alert( oPerson:Describe() )
 RETURN

 CLASS Person
    DATA Name INIT ""

    METHOD New() CONSTRUCTOR

    ACCESS Eyes INLINE ::pvtEyes
    ASSIGN Eyes( x ) INLINE IIF( ValType( x ) == 'C' .AND. ;
                 x IN "Blue,Brown,Green", ::pvtEyes := x,; 
                 Alert( "Invalid value" ) )

    // Sample of IN-LINE Method definition
    INLINE METHOD Describe()
       LOCAL cDescription

       IF Empty( ::Name )
          cDescription := "I have no name yet."
       ELSE
          cDescription := "My name is: " + ::Name + ";"
       ENDIF

       IF ! Empty( ::Eyes )
          cDescription += "my eyes' color is: " + ::Eyes
       ENDIF
    ENDMETHOD

    PRIVATE:
       DATA pvtEyes
 ENDCLASS

 // Sample of normal Method definition.
 METHOD New( cName ) CLASS Person

   ::Name := cName

 RETURN Self

 

Tools

  • HBMK2 – Powerful build tool like make
  • HBDoc2 and  HBExtern – Creates documentation for Harbour
  • HPPP – Pre-processor, a powerful tool which avoids typical problems found on C language pre-processor
  • HBFormat – Formats source code written on Harbour or another dialect according defined rules
  • HBi18n – Tools to localizing text on applications
  • HBRun – Shell interpreter for Harbour. Macro compiling allows to run any valid Harbour code as it’s being compiled
  • HBIDE – Integrated Development Environment to help Harbour development and various xBase dialects

All tools are multiplatform.

Development

Today Habour development is leading by Viktor Szakáts with huge collaborations and leading many components of core and contribs by Przemysław Czerpak. HBIDE and some components, specially HBQt, are developed by Pritpal Bedi. Others members send minor changes to the Sourceforge SVN repository.  As 2010 Harbour development is keeping vibrant activity

Popularity

Although there is no way to measure popularity of Harbour or xBase, the TIOBE Programming Community Index As of June 2006 ranked Microsoft Visual FoxPro, a high profile dialect of xBase, on 12th position on programming languages popularity ranking. FoxPro/xBase ranked on 25th position As of August 2010. As of September 2010, the Clipper Usenet newsgroupscomp.lang.clipper is still active. As of August 2010 Harbour figured on 16th position on weekly downloads in compiler category and 132th position on global rank.

xHarbour comparison

xHarbour is a fork 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.

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.

The Harbour developers explicitly reject extensions to the language where those extensions would break Clipper compatibility. These rejections were soften recently since the new Harbour architecture allow extensions out of the core compiler.

A detailed comparison between extensions implemented in Harbour and xHarbour can be found in SVN repository of the project on SourceForge.

As of 2009–2010, Harbour has seen a huge increase in its adoption while xHarbour decline as can be seen on his mailing list

See also

References

  1. ^ Harbour license
  2. ^ LetoDB
  3. ^ Official Harbour page
  4. ^ http://sourceforge.net/projects/harbour-project/
  5. ^ TIOBE Programming Community Index
  6. ^ SourceForge
  7. ^ About xHarbour
  8. ^ xhb-diff.txt
  9. ^ Harbour developers’ mailing list statistics
  10. ^ xHarbour developers’ mailing list statistics
  11. ^ ohloh.net Activity comparison

External links

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Note : This post borrowed by curtesy of Vikipedia from here : http://en.wikipedia.org/wiki/Harbour_(software)