Harbour is an open source programming language created in 1999 by Antonio Linares.
#666on PLDB | 25Years Old | 45Repos |
Harbour is a modern computer programming language, primarily used to create database/business programs. It is a modernized, open sourced and cross-platform version of the older Clipper system, which in turn developed from the dBase database market of the 1980s and 90s. Harbour code using the same databases can be compiled under a wide variety of platforms, including Microsoft Windows, Linux, Unix variants, several BSD descendants, Mac OS X, MINIX 3, Windows CE, Pocket PC, Symbian, iOS, Android, QNX, VxWorks, OS/2/eComStation, BeOS/Haiku, AIX and MS-DOS.. Read more on Wikipedia...
PROCEDURE Main()
? "Hello World"
RETURN
#include "hbclass.ch"
PROCEDURE Main()
LOCAL oPerson
CLS
oPerson := Person():New( "Dave" )
oPerson:Eyes := "Invalid"
oPerson:Eyes := "Blue"
Alert( oPerson:Describe() )
RETURN
CREATE CLASS Person
VAR Name INIT ""
METHOD New( cName )
METHOD Describe()
ACCESS Eyes INLINE ::pvtEyes
ASSIGN Eyes( x ) INLINE iif( HB_ISSTRING( x ) .AND. x $ "Blue,Brown,Green", ::pvtEyes := x, Alert( "Invalid value" ) )
PROTECTED:
VAR pvtEyes
ENDCLASS
// Sample of normal Method definition
METHOD New( cName ) CLASS Person
::Name := cName
RETURN Self
METHOD Describe() CLASS Person
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
RETURN cDescription
Feature | Supported | Example | Token |
---|---|---|---|
Strings | ✓ | "Hello world" | " |
Comments | ✓ | // A comment | |
Line Comments | ✓ | // A comment | // |
Semantic Indentation | X |