C5DG-4 DBFCDX Driver

Clipper 5.x – Drivers Guide

Chapter 4

DBFCDX Driver Installation and Usage

DBFCDX is the FoxPro 2 compatible RDD for Clipper. As such, it connects to the low-level database management subsystem in the Clipper architecture. When you use the DBFCDX RDD, you add a number of new features including:

. FoxPro 2 file format compatibility

. Compact indexes

. Compound indexes

. Conditional indexes

. Memo files smaller than DBFNTX format

In This Chapter

This chapter explains how to install DBFCDX and how to use it in your applications. The following major topics are discussed:

. Overview of the DBFCDX RDD

. Installing DBFCDX Driver Files

. Linking the DBFCDX Driver

. Using the DBFCDX Driver

Overview of the DBFCDX RDD

The DBFCDX driver lets you create and maintain (.cdx) and (.idx) files with features different from those supplied with the original DBFNTX driver and is compatible with files created under FoxPro 2. The new features are supplied in the form of several syntactical additions to the INDEX and REINDEX commands. Specifically, you can:

. Create indexes smaller than those created with the DBFNTX
driver. The key data is stored in a compressed format that
substantially reduces the size of the index file.

. Create a compound index file that contains multiple indexes
(TAGs), making it possible to open several indexes under one file
handle. A single (.cdx) file may contain up to 99 index keys.

. Create conditional indexes (FOR / WHILE / REST / NEXT).

. Create files with FoxPro 2 file format compatibility.

Compact Indexes

Like FoxPro 2, The DBFCDX driver creates compact indexes. This means that the key data is stored in a compressed format, resulting in a substantial size reduction in the index file. Compact indexes store only the actual data for the index keys. Trailing blanks and duplicate bytes between keys are stored in one or two bytes. This allows considerable space savings in indexes with much empty space and similar keys. Since the amount of compression is dependent on many variables, including the number of unique keys in an index, the exact amount of compression is impossible to predetermine.

Compound Indexes

A compound index is an index file that contains multiple indexes (called tags). Compound indexes (.cdx)’s make several indexes available to your application while only using one file handle. Therefore, you can overcome the Clipper index file limit of 15. A compound index can have as many as 99 tags, but the practical limit is around 50. Once you open a compound index, all the tags in the file are automatically updated as the records are changed.

Once you open a compound index, all the tags contained in the file are automatically updated as the records are changed. A tag in a compound index is essentially identical to an individual index (.idx) and supports all the same features. The first tag (in order of creation) in the compound index is, by default, the controlling index.

Conditional Indexes

The DBFCDX driver can create indexes with a built-in FOR clause. These are conditional indexes in which the condition can be any expression, including a user-defined function. As the database is updated, only records that match the index condition are added to the index, and records that satisfied the condition before, but don’t any longer, are automatically removed.

Expanded control over conditional indexing is supported with the revised INDEX and REINDEX command options as in the new DBFNTX driver.

Installing DBFCDX Driver Files

The DBFCDX driver is supplied as the file, DBFCDX.LIB.

The Clipper installation program installs this driver in the \CLIPPER5\LIB subdirectory on the drive that you specify, so you need not install the driver manually.

Linking the DBFCDX Database Driver

To link the DBFCDX database driver into an application program, you must specify DBFCDX.LIB to the linker in addition to your application object files (.OBJ).

1. To link with .RTLink using positional syntax:

C>RTLINK <appObjectList> ,,,DBFCDX

2. To link with .RTLink using freeformat syntax:

C>RTLINK FI <appObjectList> LIB DBFCDX

Note: These link commands all assume the LIB, OBJ, and PLL environment variables are set to the standard locations. They also assume that the Clipper programs were compiled without the /R option.

Using the DBFCDX Database Driver

To use FoxPro 2 files in a Clipper program:

1. Place REQUEST DBFCDX at the beginning of your application or at the top of the first program file       (.prg) that opens a database file using the DBFCDX driver.

2. Specify the VIA “DBFCDX” clause if you open the database file with the USE command.

    -OR-

3. Specify “DBFCDX” for the <cDriver> argument if you open the database file with the DBUSEAREA()       function.

   -OR-

4. Use ( “DBFCDX” ) to set the default driver to DBFCDX.

    Except in the case of REQUEST, the RDD name must be a literal character string or a variable. In all       cases it is important that the driver name be spelled correctly.

The following program fragments illustrate:

  REQUEST DBFCDX
  .
  .
  .
  USE Customers INDEX Name, Address NEW VIA "DBFCDX"

     -OR-

  REQUEST DBFCDX
  RDDSETDEFAULT( "DBFCDX" ) .
  . 
  .
  USE Customers INDEX Name, Address NEW

Using (.idx) and (.ntx) Files Concurrently

You can use both (.idx) and (.ntx) files concurrently in a Clipper program like this:

// (.ntx) file using default DBFNTX driver
 USE File1 INDEX File1 NEW
// (.idx) files using DBFCDX driver
 USE File2 VIA "DBFCDX" INDEX File2 NEW

Note, however, that you cannot use (.idx) and (.ntx) files in the same work area. For example, the following does not work:

USE File1 VIA "DBFNTX" INDEX File1.ntx, File2.idx

Using (.cdx) and (.idx) Files Concurrently

You may use (.cdx) with (.idx) files concurrently (even in the same work area); however, in most cases it is easier to use a single (.cdx) index for each database file or separate (.idx) files. When using both types of index at the same time, attempting to select an Order based on its Order Number can be confusing and will become difficult to maintain.

File Maintenance under DBFCDX

When an existing tag in a compound index (.cdx) is rebuilt using INDEX ON…TAG… the space used by the original tag is not automatically reclaimed. Instead, the new tag is added to the end of the file, increasing file size.

You can use the REINDEX command to “pack” the index file. REINDEX rebuilds each tag, eliminating any unused space in the file.

If you rebuild your indexes on a regular basis, you should either delete your (.cdx) files before rebuilding the tags or use the REINDEX command to rebuild them instead.

DBFCDX and Memo Files

The DBFCDX driver uses FoxPro compatible memo (.fpt) files to store data for memo fields. These memo files have a default block size of 64 bytes rather than the 512 byte default for (.dbt) files.

DBFCDX memo files can store any type of data. While (.dbt) files use an end of file marker (ASCII 26) at the end of a memo entry, (.fpt) files store the length of the entry. This not only eliminates the problems normally encountered with storing binary data in a memo field but also speeds up memo field access since the data need not be scanned to determine the length.

Tips For Using DBFCDX

1. Make sure index extensions aren’t hard-coded in your application. The default extension for DBFCDX indexes is (.idx), not (.ntx). You can still use (.ntx) as the extension as long as you specify the extension when you create your indexes. The best way to determine index extensions in an application is to call ORDBAGEXT().

For example, if you currently use the following code to determine the existence of an index file:

IF .NOT. FILE("index.ntx")
    INDEX ON field TO index
ENDIF

Change the code to include the INDEXEXT() function, as follows:

IF .NOT. FILE("index"+ORDBAGEXT())
   INDEX ON field TO index
ENDIF

2. If your application uses memo fields, you should convert your (.dbt) files to (.fpt) files.

There are some good reasons for using (.fpt) files. Most important is the smaller block size (64 bytes). Clipper’s (.dbt) files use a fixed block size of 512 bytes which means that every time you store even 1 byte in a memo field Clipper uses 512 bytes to store it. If the data in a memo field grows to 513 bytes, then two blocks are required.

When creating (.fpt) files, the block size is set at 64 bytes to optimize it for your needs. A simple conversion from (.dbt) files to (.fpt) files will generally shrink your memo files by approximately 30%.

3. Add DBFCDX.LIB as a library to your link command or link script.

Summary

In this chapter, you were given an overview of the features and benefits of the DBFCDX RDD. You also learned how to link this driver and how to use it in your applications.

C5DG-1 Introduction

Clipper 5.x – Drivers Guide

Chapter 1

Introduction

Important!

Some of the topics in this guide are intended for advanced Clipper developers. Much of this information is presented at a fairly high level and requires programming knowledge beyond the Clipper language. Other parts are useful to users of all levels. Refer to the “User Interface Levels” section of the Replaceable Database Driver Architecture chapter to determine which part of the language is appropriate to your level of expertise.

Based on your own experience level with the Clipper language, you should decide whether you wish to take advantage of these new and advanced features. The Reference guide contains existing Clipper command and function syntax and descriptions. This guide addresses new extensions to Clipper. Understanding this information should enable you to increase the power and effectiveness of your applications.

Clipper supports a driver architecture that allows Clipper- compiled applications to use replaceable database and terminal drivers. This Drivers guide contains all the information you need to use the replaceable drivers provided as part of the Clipper Development System.

Overview of RDD System

RDD is an abbreviation for Replaceable Database Driver, and it is used to describe an interface that controls how your application accesses and manipulates database and ancillary files.
Clipper provides several RDDs to give you access to the database, memo, and index file formats of many popular database software products. By simply linking the proper RDD with your application, you get automatic, easy access to files created by other database engines.

Moreover, Clipper gives you new and enhanced commands and functions designed to make your applications independent of the RDD in use. Using RDDs, you can give end users more flexibility in choosing to migrate to your Clipper applications without losing data and to easily move their data back and forth between applications if they prefer.

Overview of Alternate Terminal Drivers

An Alternate Terminal Driver is a library file (.LIB) that controls how your application addresses the screen output device. Clipper provides several Alternate Terminal Drivers to allow your applications to run in a wider variety of environments.

Note: To perform normal information presented in screen input/output in a Clipper application, you do not need the Drivers guide. The default database and terminal drivers are automatically linked and the commands and functions used for these purposes are discussed in the Reference guide. For several categorized lists of these commands and functions, refer to Appendix G: Categorized Language Tables in the Error Messages and Appendices guide.

In This Guide

This guide consists of nine chapters including this Introduction chapter.

For an online version of this guide accessible while operating your program editor or any other development utility, use The Guide To Clipper.

Chapter 2: Replaceable Database Driver Architecture

The Clipper database system supports a driver architecture that makes Clipper-compiled applications data format independent. Such applications can, therefore, access the data formats of other database systems, including the dBASE IV (.mdx), FoxPro (.cdx), and Paradox (.db) formats on a variety of equipment. This chapter discusses how RDDs fit into the overall Clipper architecture, defines the basic terminology you will need to understand subsequent chapters, and summarizes new and enhanced commands and functions designed to support the RDD architecture.

Chapter 3: Reference

Clipper 5.x provides many new and enhanced commands and functions that you will use to access and manipulate databases and to get specific information about the RDD in use. This chapter contains entries for all new Clipper commands and functions designed for use with RDDs. As for existing language elements, only those that were changed to accommodate the new RDD architecture are documented here. Other language elements that are specifically designed for database manipulation and have not been altered (e.g., USE) are documented in the Reference guide.

Chapter 4: DBFCDX Driver Installation and Usage

The DBFCDX database driver provides access to FoxPro 2 (.cdx) and (.idx) file formats. This chapter explains how to install DBFCDX and how to use it in your applications.

Chapter 5: DBFMDX Driver Installation and Usage

The DBFMDX database driver provides access to dBASE IV (.dbf), (.mdx), and (.dbt) file formats. The driver also supports dBASE IV-compatible file and record locking schemes, allowing shared access between Clipper and dBASE IV programs. This chapter explains how to install DBFMDX and how to use it in your applications.

Chapter 6: DBFNDX Driver Installation and Usage

The DBFNDX database driver uses the Clipper driver architecture to access dBASE III PLUS compatible index files within a Clipper program, allowing you to create, access, and update dBASE III and dBASE III PLUS compatible index (.ndx) files. This chapter explains how to install DBFNDX and how to use it in your applications.

Chapter 7: DBFNTX Driver Installation and Usage

DBFNTX is the default database driver for Clipper that lets you create and maintain (.ntx) files with features above and beyond those supplied with previous versions of DBFNTX. This chapter details these new features and explains how to install and use DBFNTX in your applications.

Chapter 8: DBPX Driver Installation and Usage

The DBPX database driver provides access to Paradox 3.5 (.db), (.px), (.x) and (.y) file formats. This chapter explains how to install DBPX and how to use it in your applications.

Chapter 9: Alternate Terminal Drivers

Clipper provides several Alternate Terminal Drivers to allow your applications to run in a wider variety of environments. This chapter discusses how Alternate Terminal Drivers fit into the overall Clipper architecture, as well as how to install and use each of the supplied terminal drivers: ANSITERM, NOVTERM, and PCBIOS.

Format of xBase Files

xBase File Format Description

xBase File Types

xBase File  Types and Extensions

Ext. File Type  Introduced or used by
.$$$ temporary file  dBASE III
.$db temporary file  dBASE IV
.act FoxDoc Action Diagrams  FoxPro
.app application object file  dBASE Appl. Generator
.app generated application  FoxPro
.bak Backup file  dBASE
.bar horizontal bar menu object file  dBASE Appl. Generator
.bin Binary files  dBASE
.bch batch process object file  dBASE Appl. Generator
.cac executable when caching on/off  dBASE IV
.cat catalog  dBASE III, IV
.cdx compound index  FoxPro
.ch header file  Clipper
.cht interface file for ChartMaster  dBASE
.clp compiler script file (clip list)  Clipper
.cmd command  dBASE – Waffle
.cod template source file  dBASE Appl. Generator
.cpt encrypted memo file  dBASE
.crp encrypted database  dBASE IV
.ctl control file  dBASE IV – Aldus Setup
.cvt backup file for CONVERTed database file  dBASE IV
.db configuration  dBASE
.db$ temporary file  dBASE
.db2 database  dBASE II
.db3 database  dBASE III
.dbf database file  dBASE – FoxPro
.dbk database backup  dBASE IV
.dbo compiled program  dBASE IV
.dbt FoxBASE+ style memo  FoxPro
.dbt memo file for database w/same name  dBASE – Clipper
.def Definitions list  dBASE
.dif Data Interchange Format. For APPEND FROM, COPY  dBASE – VisiCal
.doc Documentation text file  dBASE Appl. Generator
.fil files list object file  dBASE Appl. Generator
.fky macro file  FoxPro
.fmo compiled format file  dBASE IV
.fmt format file  dBASE – FoxPro – Clipper
.fp configuration file  FoxPro
.fpc catalog  FoxPro
.fpt memo  FoxPro
.fr3 renamed dBASE III+ form file  dBASE IV
.frg uncompiled report file, code fragment file  dBASE IV
.frm report file  dBASE – Clipper
.fro compiled report file  dBASE IV
.frt report memo  FoxPro
.frx report  FoxPro
.fw2 Framework spreadsheet or database file  Framework – dBASE
.fxp compiled format  FoxPro
.gen compiled template  dBASE Appl. Generator
.idx index (many)  FoxPro
.ind include index  dBASE IV
.inx index  FoxBase
.key Key macro library  dBASE
.lbg label generator data  dBASE IV
.lbl label  dBASE – Clipper
.lbo compiled label  dBASE IV
.lbt label memo  FoxPro
.lbx label  FoxPro
.ld1 overlay file  dBASE
.log Transaction log file  dBASE
.mbk multiple index file backup  dBASE IV
.mdx multiple index file  dBASE IV
.mem memory variable save file  dBASE – FoxPro
.mnt menu memo  FoxPro
.mnx menu  FoxPro
.mpr generated program  FoxPro
.mpx compiled menu program  FoxPro
.ndx index file  dBASE
.npi source for DGEN.EXE interpreter  dBASE Appl. Generator
.ntx index file  Clipper
.pjt project memo  FoxPro
.pjx project  FoxPro
.plb library  FoxPro
.pll pre-linked library  Clipper
.plt pre-linked transfer file  Clipper
.pop pop-up menu object  dBASE Appl. Generator
.ppo pre-processor output  Clipper
.pr2 printer driver  dBASE IV
.pr3 PostScript printer driver  dBASE IV
.prf printer driver  dBASE IV
.prg program source file  dBASE – FoxPro – Clipper
.prs procedure  dBASE IV
.prt Print dump  dBASE
.prx compiled program  FoxPro
.qbe saved query (Query By Example)  dBASE IV – Quattro Pro
.qbo compiled query  dBASE IV
.qpr generated query program  FoxPro
.qpx compiled query program  FoxPro
.qry query  dBASE IV
.res dBASE resources  dBASE IV
.rpd Rapid file. For IMPORT/EXPORT,APPEND  FROM, COPY  dBASE
.sc3 renamed dBASE III screen mask file  dBASE IV
.scr screen – screen snapshot  dBASE IV
.sct screen memo  FoxPro
.scx screen  FoxPro
.spr generated screen program  FoxPro
.spx compiled screen program  FoxPro
.str structure list object file  dBASE Appl. Generator
.t44 Temporary file for Sort or Index  dBASE IV
.tbk memo backup  dBASE IV – FoxPro
.tvf table view settings  dBASE
.upd update data  dBASE
.upo compiled update data  dBASE
.val values list object file  dBASE Appl. Generator
.vew view file  Clipper, Lotus Approach
.vue view  dBASE IV – FoxPro
.w44 temporary file for Sort or Index  dBASE
.wfm form object  dBASE Form Designer
.win window file  FoxPro – dBASE

Source :  http://www.clicketyclick.dk/databases/xbase/format/index.html

Notes:

–          Such a list can’t be perfect. Some item may be obsolete / forgotten and something may not exist when this list compiled.

–          “Clipper” may not include all versions of Clipper.

–          Most of Clipper files are supported by Harbour.

Clipper characteristics

Clipper, characteristics and versions

Clipper is procedural and imperative Programming language created in 1985 by Nantucket Corporation and sold later to Computer Associates, the one commercialized that it like CA-Clipper. At first Clipper was created as Compiler for the managing system interpreter of data bases dBase III (in fact seasonal versions of Nantucket included a label indicated that it thus), but with time the product evolved and matured, becoming a compiled language more powerful than the original one, not only by its own implementations but also by the extensions developed by third parties in C, Assembly and Pascal, of which it was inheriting characteristic. This turned into the tool leader of development of applications of relational databases under operating system MSDOS, mainly programs of management, accounting and invoicing ( SAGE – SP, leader of the Spanish market, uses for Contaplus and FacturaPlus ), commercial agendas and programs of pricing (approximately 80% of the insurance agencies of Spain used it in the programs of their agents).

Characteristics

Unlike other x-Base languages, Clipper never counted on a way Interpreter, similar to the one of dBase . Its utilities for handling of Base of data, such as the one of creation of tables (DBF), they gave with the source code written in Clipper and including, the user could adapt them to his needs if he wanted. They also contributed to many routines written in C and Assembly to which the user could go, to extend and even to create libraries of pre-connects complete.

Clipper works in way pure Compiler generating an object code binary; the package also provided a connector (RTLINK or DLINK) that with the object module and the libraries of pre-connects generated ejecuble a module direct. This last one granted to the Clipper applications a speed to him that other managers of data bases did not own, and, like disadvantage, the necessity to recompilar and to connect again whenever some error in the source code was corrected ( Purification was slow).

It owns characteristics that were very attractive for their time and its surroundings of work (TWO), such as: own handling of Virtual memory ( ram in disc); handling of extended memory, the applications could overcome the barrier of 640Kb of ram imposed by MSDOS ; routines and libraries can be only loaded when they are necessary and they unload of ram when no longer they make lack (it connects and overlays dynamic); the amount of registries by tables only was limited the capacity of the disc; great robustness in the applications, particularly in the designed ones for client-servant (network LAN), etc.

Although it did not own practically calculation functions such as the trigonometrical ones, that other languages like FoxPro if they incorporated; the user them could easily elaborate in C and use them like any other function of own bookstore of the package, advantage that happened of which the Clipper compiler and many of their libraries were almost completely developed in C .

Its form, administration, storage and interchange of screens were simple, effective and quick; what good dynamism to the applications developed with Clipper granted.

The language in if he were powerful, counting with a great amount of sentences, functions, memory management and variables that allowed to the programmer very flexible and efficient developments; in reasonably fast form. Also the package included complete “manual in line navegable”, that ram was loaded in memory, to requirement of the programmer, and it was acceded by the single pressure of a pair of keys.

At his long time sea bream, it has been, probably, the language relational database manager of ” low and medium porte” more used in the world. Today many Clipper developers even exist (some grouped communities and with forums in Internet), that make applications, style Windows, even using their own graphical libraries written in C and Assembly .

The first versions

The first versions denominate seasonal versions to make reference to a station of the year in their official names. All of them name like dBASE compilers . These were:

  • Nantucket Clipper Winter’84 – sent 25 of May of 1985
  • Nantucket Clipper Summer’85 – sent in 1985
  • Nantucket Clipper Winter’85 – sent 29 of January of 1986
  • Nantucket Clipper Fall’86 – sent 31 of October of 1986
  • Nantucket Clipper Summer’87 – sent 21 of December of 1987
  • Gatsoft Clipper Summer’88 – sent 16 of March of 1988

Clipper 5

Clipper 5.0 supposes a qualitative jump of the language, although it begins bad. Given the increasing popularity (Summer 87 has been used until the year 2000 like development tool), it is decided to concentrate more in extending the language that in being improved compiler of dBase. They are implemented therefore pseudo-objects and other improvements… but the product sends with numerous bugs that make that the objective public dissuades itself and continues using the Summer87 version, much more stable. The 5,01 correct many of the problems, but it will not be until the 5,2 that take place upsets massive of the developers.

Versions 5 of Nantucket are:

  • Nantucket Clipper 5,00 – sent in 1990
  • Nantucket Clipper 5,01 – sent 15 of April of 1991
  • Nantucket Clipper 5,01 Rev.129 – sent 31 of March of 1992

The American multinational Computer Associates acquires Nantucket and it is sent to improve the product strengthening the inherited characteristics of C, in particular the data type code-block (literally code block, a hybrid between macros of dBase, the evaluation of chains of characters and the leaders of functions). Another one of the improvements coming from version 5.0 is the system “Replaceable Drivers” Database; (RDD or basic drivers replacable of data), that allows with a single sentence to change between different basic norms from data. The appearance of version 5.2, with a frenetic race of subversions (with improvements and correction of errors) until 5.2c, that marks the beginning of the massive migration of those who still remained in Summer’87. The version of used Clipper of history happens more therefore. Contrary, her successor, 5,3, in spite of implementing improvements, falls in a bulk error, when not considering the compatibility with at least the most popular libraries of Clipper (as much commercial as freeware), and to consume excessive resources of TWO.

  • CA Clipper 5.01a –
  • CA Clipper 5,20 – sent 15 of February of 1993
  • CA-Clipper 5.2a – sent 15 of March of 1993
  • CA Clipper 5.2b – sent 25 of June of 1993
  • CA-Clipper 5.2c – sent 6 of August of 1993
  • CA Clipper 5.2d – sent 25 of March of 1994
  • CA-Clipper 5.2e – sent 7 of February of 1995
  • CA Clipper 5,30 – sent 26 of June of 1995
  • CA Clipper 5.3a – sent 20 of May of 1996
  • CA Clipper 5.3b – sent 20 of May of 1997

Computer Associates decides to leave Clipper before the might of Microsoft Windows, and overturns part of the development of Clipper ( project Reels of Nantucket) to its new tool CA-Line of vision Objects, that appears at the same time as 5.3 almost Clipper but the abandonment of the syntax x-Base and not to provide a tool with adapted migration, together with the high price of the product (that in addition debia to compete with other products of the own house, one of them based on BASIC ), causes that the thickness of Clipper programmers chooses to remain in versions 5.3 with libraries of third parties like FiveWin, or migrate to tools x-Base like Visual FoxPro as market TWO is reduced.

22 of April of 2002 Computer Associates and GrafX Software announces that they have reached an agreement of licensing, marketing and development of two of its languages of development: CA-Clipper and CA-Line of vision Objects.

One of the main characteristics that helped the success of Clipper was the possibility of expanding the language with routines in C and ensablador. Several of them, as CodeBase or Apollo is RDDs. With the appearance of Windows several of them were developed to carry the Clipper applications to Windows. Most popular she is the FiveWin Spanish, employee in products leaders of accounting in Spain.

In addition, the use of linkers alternative allowed to improve the generated yield of the feasible one. The most acclaimed it was Blinker, that adds a extensor of with TWO protected mode (it is used with numerous languages and compilers). It added support to compile programs and libraries for Windows.

At present the Clipper language is actively being implemented and being extended by several projects and salesmen. Between the projects of free Software we can emphasize Paper clip, Harbor and XHarbour . Between the commercial compilers XBase++ and Visual FlagShip. And Other products like ” MEDIATOR” that they offer the possibility him of connecting itself to relational Database servers like MS-SQL, MySQL and Oracle.

XBase++ has been called the Clipper Compiler of 32 bits, being at the moment the leader in innovations and incorporations to the language. Or they have been sold more than 25,000 copies of the compiler and they use from solitary developers to great companies like Hewlett-Packard or the Government of Canada.

Several of those implementations are portable thanks to their development in C ( TWO, Windows, Linux (32 and 64 bits), Unix (32 and 64 bits), and Mac OS X ), supporting several extensions of the language; they count on several extensions of the language, and several Replaceable Drivers Database (RDD) that the most popular formats of tables support, like DBF, DBTNTX, DBFCDX ( FoxPro and Comix), MachSix (Apollo), SQL, and more. All these new implementations maintain the complete compatibility with the standard x-Base sintax , at the same time as and syntax oriented to the destiny like SQLExecute()offer Object-oriented programming .

At the moment there is a free version, the Harbor Project that it has like original objective to be 100% compatible one with version 5.2 (most popular of the versions of Clipper), also are addition new characteristic like support for SQL through SQLite. Harbor is available for multiple platforms, including not only MSDOS and Windows, but also to Linux, OS/2 and others. In the month of August of the 2008 the launching of version 1.0 announced officially.

In 2005, Newsgroup of Usenet regarding Clipper comp.clipper and comp.visual-objects follow assets.

Programming in Clipper

Simple Hello world :

? ” Hello World! “

A simple mask of entrance of Base of data :

USE Customer SHARED NEW

clear screen
@  1, 0 SAY "CustNum" GET Customer->CustNum PICT "999999" VALID Customer->CustNum > 0
@  3, 0 SAY "Contact" GET Customer->Contact VALID !empty(Customer->Contact)
@  4, 0 SAY "Address" GET Customer->Address
READ

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note : This article Gathered from here.

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)      

Mere Clipper

An article by Roger Donnay, March, 1998
.
We often do not realize the importance of people and events until many years later when the dust has settled and we can put them into perspective. Three years ago I was asked to write an article for the CDGN Magazine. It was titled “Back to the Future” and it dealt with the the role of Clipper in 1995 and into the future. I recently broke out my old copy of CDGN magazine and reread the article to see if my predictions match the current landscape.
.
I predicted that I would be writing my final article about Clipper in the year 2035. Many of you assumed that either I was much younger than I really am, that this was a typographical error, or that I had already lost it and was living on a ranch somewhere in California with Ronald Reagan. None of the above are true. I am now fifty-four years old. In the year 2035, I will be 91 years old but I will still be programming because in the year 2007 we will discover a new drug that restores dead brain cells. The year 2035 will mark the year that we finally arise from the ashes of the “great computer meltdown” of 2010. The meltdown will occur because of the Year 2000 debacle which will create a world-wide depression and create a political climate of hatred towards programmers that will build to a frenzy leading to “The Night of Broken Disks”. Computer programmers will be fleeing to Russia, Iran and Iraq – the only safe havens in the world that will not be affected by the “Great-Satan Virus” due to their refusal to connect to the Information SuperHighway.
.
This great oppression of computer programmers will force those who are not killed outright, or sent to “de-programming camps” made their escape to third-world countries to hide for years in attics, befriended by a few, brave souls who know it is not their fault they were born “computer-literate”. During this 20-year war on computers, an arsenal of “giant magnets” are created by the new war machine and the industrialized cities of the world are bombed with the largest “de-gaussing” campaign in history. No piece of software or database will be safe from annilation. Finally, the great war machine is defeated because it will fail to realize that it cannot maintain such a war when it destroys the very machines and software that allow it to wage war.When it is all over, a discovery is made in a little house on the Prinsengracht in Amsterdam. A old notebook computer is found in the attic and sent to a museum. While restoring the computer, a small disk is found, still fused in the disk drive. Because of its condition, it appears that the notebook had been there for many years. Much work goes into the restoration of the disk and its data and finally, it is discovered that the disk contains the diary of a young, computer-literate girl who had lived in hiding for many years. By this time, the only computer-literate people left in the world only speak Russian or Farsi, so it takes much effort to figure out how to decipher the data on the disk. Finally, a compelling and sad story emerges about a young girl who struggles to maintain her innocence, her sanity, her computer-proficiency, and her faith in God while hiding from the great de-gaussing and de-programming regime.
.

It is a sad story, and it takes time for the world to really understand her story, especially her references to “The Book of Clipper”. What was Clipper? Was this what helped her maintain her sanity and her faith in God? What happened to the young girl? Her story spreads around the world, and a never-ending search continues for a copy of “The Book of Clipper”. Finally, the search ends in a little Russian town. Not a single person realizes that “The Book of Clipper” is a reference to the manual for the computer language that every single Russian speaks fluently, until someone finds a copy of the manual that Larry Heimendinger had left at the only Russian Clipper conference ever held – in 1992. It is dusty and worn, but it is the only book left that tells the true story of Clipper. Even though every programmer in Russia can speak Clipper, not a single one of them has seen a copy of “The Book of Clipper” because none had ever been sold. The software had been pirated, and then spread from disk to disk throughout the country while the story of Clipper passed from mouth to mouth. The Russians are the only civilized society that still has a programming language, so they offer it as a gift to the world, and the world becomes whole again, and the people rejoyce, and I come out of hiding – to write my final article about Clipper.

It’s a Wonderful Life

I like to imagine that I am the angel in the story “It’s a Wonderful Life” and that I have been called on by God to rescue a person who feels that his life has been lived in vain. In my rendition of the story, the desperate soul is not George Bailey but instead is Tom Rettig. Tom passed away about a year ago and I find myself haunted by him because I feel that I have never given back to him what he gave to me and the rest of the world. I often think back at what my life was like in the mid 80’s. After many successful years as an Electronics Engineer my life was just not working anymore. Thieves broke into my business office and stole my computers and my software (including the backups). I was struggling with a failing computer-accessories manufacturing business that had pushed me deep into debt, and then my wife decided to just leave one day and head for greener pastures. I thought she had been kidnapped because she disappeared without a trace.

Arlo Guthrie once wrote a song about “The Last Man”. He said “You think you’ve got it bad? Look at that guy?.” I WAS that guy.

Then, one day, in early 1986 I was struggling with a problem trying to get dBase-III to work properly on my new peer-to-peer network. I recall making a tech support call to the network developer and the person on the phone asked “Are you compiling with Clipper?”

This simple question, in retrospect, was equivalent to someone posting a huge sign “Except a man be born again, he cannot see the kingdom of God”. Clipper was my salvation. It allowed me to layeth down in green pastures and it restoreth my soul. So how did it come about that a person could be saved from the depths of depravity by a mere software product? We all have our stories of salvation, and they all take us down different paths but they all lead to the same place. My story in not unlike C.S. Lewis’ story in “Mere Christianity”, except the players are different. The Book of Clipper is not one story, but hundreds of stories all evolving from the “Platitudes of Vulcan”.

Tom Rettig entered the scene around 1986 and offered an add-on product to Clipper titled “Tom Rettig’s Library”. Tom was a well-liked, generous person who eventually offered his library into the public-domain. Some of us are old enough to remember him as Jeff, the small boy in the original “Lassie” series on television in the 50’s. I first met him at a user group in Southern California. After the meeting we went to a bar for a few beers and he sat and talked to us like we had all known him for years. He inspired us to do what he did, because he was just like us. The next day, I thought “If Tom Rettig can make a successful add-on product to Clipper, so can I”. I wasn’t the only person who had seen the light that night. Tom had broken new ground, had planted the first seeds, and from these seeds, an entire community of user-groups, programmers, applications, add-on products, books, magazines, et al, grew into maturity.

Two Steps Back

Have you ever heard anyone say “He’s so far behind he’s ahead”? By now, most of you have decided that you must move on to Windows and that there is no place for Clipper in your strategy. Many of you have already done so and are experimenting with products like VO, Delphi, VB, and Power-Builder or have created applications with these development environments. I am not writing this article to suggest that in any way, this was a bad choice. I have spent sufficient time with these products to come to the realization that Windows applications can be developed by travelling many different paths. What I am offering, however, is another perspective; one that frees us to open our minds to look at the future from a different view. Many of us have been so busy and so worried about constantly moving forward that we have forgotten how we got here in the first place, by the use of an enduring and powerful language – Clipper.

So you may be thinking “What is he talking about? Clipper is Dead!”. In the sense of a product, this may be true, but in the sense of a language, it is far from true. Let’s imagine that Chinese is packaged into a product named “Visual-Chinese” and this product includes a set of design-tools for creating quick-Chinese documents that can be easily integrated into our marketing documents. Soon we would find our business opened up to a new market of 1 billion people. The product becomes instantly successful and everyone love its and uses it – until, years later, when we find that our marketing documents are not delivering any sales. Why? Because the language had to be cut and trimmed to fit into the limitations of the software environment. It becomes ambiguous, arrogant and unwanted by the very people who inspired its development, so it dies and Visual-Chinese gets thrown away like every other Visual tool. Does this mean that the Chinese language dies with the product? No. Chinese is a language that will endure. It has lots of users; it is robust, and it is mature.

The key word is “language“. Development strategies should be built around the choice of a proper language, not just a product. Clipper is a language that endures. It cannot die. It has widespread use around the world and there are hundreds of thousands of Clipper legacy applications still doing mission- critical work. Unfortunately, because the word “Clipper” is owned by CA, and because CA has essentially abandoned Clipper, it cannot endure under the name Clipper, so it must endure under another name: that name is “Xbase”. Software developers try to treat languages like they own them, but they are only temporary custodians. This leads us to a discussion of the current state of the Xbase language. Xbase currently ( 1998 ) exists in 5 dialects:

      1. dBase – A Windows-based Interpreter.
      2. FoxPro – A Windows-based Interpreter.
      3. CA-Clipper – A DOS-based Xbase compiler.
      4. CA-VO – A 32-bit Windows-based Xbase compiler.
      5. Xbase++ – A 32-bit Multi-Platform Compiler.

Xbase as dBase

dBase was the custodian of the Xbase language from around 1983 until about 1987. Unfortunately, it was an interpretive language so it never gained respectability as a true, robust language, however, it had much to offer the developer in ease-of-use and database design. dBase continues to be supported by Borland, simply because there is still money to be made in upgrades and conferences, but Borland has made it clear that they intend to make dBase programmers learn how to speak Pascal and eventually will phase Xbase out of their products.

Xbase as FoxPro

FoxPro took over as a co-custodian of the Xbase language in about 1987 and emerged around the same time as Clipper. FoxPro defeated dBase nearly overnight simply because it was faster, not because it delivered any new language concepts. FoxPro continues to be supported by Microsoft, simply because there is still money to be made in upgrades and conferences, but Microsoft has made it clear that they intend to make FoxPro programmers learn how to speak Visual Basic and eventually will phase Xbase out of their products.

Xbase as Clipper

Clipper was undoubtely the best custodian of the Xbase language from 1987 to 1996. Clipper introduced the Xbase compiler, the open-architecture concept of the extend system, code blocks, locals, statics, multi-dimensional arrays, the RDD layer, the preprocessor, and language extensions. Clipper was the first Xbase custodian to give Xbase respectability as a true programming language. Clipper maintained this respectability until around 1996 when CA released CA-Clipper 5.3. CA chose to treat Clipper as a “package” rather than a “language” and alienated nearly the entire Clipper community when they bundled a Windows-IDE and several third-party products into the package. This was when Clipper died.

Xbase as VO

Computer Associates planned for VO to take over as the custodian of the Xbase language by forcing the death of Clipper and dragging CA customers into a new kind of development environment that kind of looks like Clipper, in that it inherited much of the new Clipper extensions. Unfortunately, migration to VO became cumbersome due to too many incompatabilities, poor performance, poor reliability and a third-party community who could not get their products to work with VO. VO promised it would be easy to migrate existing Clipper applications to Windows but could not deliver on the promise. Working in VO is in no way similar to working in Clipper. Many Clipper developers find that using a third-party Windows library (like Five-Win or Clip-4-Win) with Clipper is a much easier migration path than VO.

Why Xbase?

Many of us wonder why Xbase has not been given more respectability as a “mainstream” language. If Xbase is so good, why are Borland and Microsoft phasing it out of their future products? I was watching a television program the other day about an analysis of automobile technology over the years. We often assume that the best technology is what endures over time and that it eventually rises to the top. This may be true in an ideal world, but in a capitalist society, it is usually market dog-fights that determine dominance. In this analysis, it was determined that steam technology could have produced cars just as good as internal combustion technology, but Henry Ford chose the latter. Bill Gates has chosen Basic, not because it is better, but because he owns it. He doesn’t own Xbase, and Bill cannot embrace something that he cannot control. Borland chose Pascal. Not because it is better, but becaused they own it.

Over the past 10 years, the success of the Xbase products has been due to the high degree of abstraction of the Xbase language, which makes it vastly simpler to acces and use operating system functions and resources. In addition, Xbase is more than just a specialized programming language, a database navigation language, or a user interface language – instead, it combines all of these roles, harmoniously integrating them with one another.

Xbase offers dynamic data types and is generally described as being highly “tolerant“. Taken together, these benefits have persuaded a steadily growing community of users and developers to rely upon it as a choice for implementing mission-critical and commercial PC-desktop applications. In fact, world-wide, more than one-third of all DOS-based commercial applications now in use were written in Xbase, with Clipper accounting for the major share.

Square Pegs and Round Holes

Most Windows programmers will tell you that you cannot take a standard Clipper application with @SAY..GETS, Menu Prompts, etc, and convert it to a Windows GUI program without a major change in the architecture and the functionality of the program. They claim that a text-based, modal design has too little in common with GUI-based, event-driven, non-modal design. They will tell you that it like trying to fit a square peg into a round hole. For years, I believed this because it made sense. I, like everyone else, wrote my Windows applications with a different structure than my Clipper applications. They were built around an event model rather than a procedural model and the code was tightly-bound rather than loosely-bound to the functional model. This always leaves me with an uneasy feeling because it forces me to write applications that are less modular and are platform specific. Microsoft, Borland, and CA each wants us to build applications their way. They want us to learn their programming tools, their methods, their plug-ins, their workshops, and their studios – not their language. Why? Because applications built around their environment will be harder to migrate to competitor’s products than applications built around a language.

So they make sure that the language is difficult and inaccessible, and that the application cannot be maintained or migrated to any other platform, other than platforms that they support. Programmers, however, have to survive in the real world and this requires platform flexibility. The reason why so many mission- critical DOS applications are still surviving in the real world is because each development platform supports DOS as a subset, so DOS has been, out of necessity, elevated to the status “platform independent”. I can run my Clipper applications under MS-DOS, PC-DOS, DR-DOS, OS/2, Windows 3.1, Windows 95, Citrix- Winframe, MULTI-DOS, Windows NT and Novell-DOS. I can run my Delphi applications only under 32-bit Windows. Is this a step forward?

Cocoon

In my dream, the “Ghost of Xbase Future” led me through the Land of Clipper and how it might look like up through the year 2035. I couldn’t hold back my emotions as I witnessed the data meltdown and the termination of millions of programmers. I asked him “Spirit – is this a vision of how things MUST be or how things COULD be?” He never answered me. I woke up from my dream and ran to the mirror. I was relieved to see that I wasn’t 91 years old but was still a young man. I exclaimed “There’s still time!” I bolted to the window, looked out, and saw that The Land of Clipper looks different than it did yesterday. The paths are 32-bits wide and they lead everywhere, yet they look familiar and something tells me that there is nothing to fear at the end of these paths. Then I realized that I had not been dreaming and that Clipper had not really died at all but had been in a cocoon, waiting to metomorphose into a butterfly, one with big X’s on it’s wings. The butterfly is beautiful and it attracts the attention of people like Dirk Lesko (author of Funcky), of Jud Cole (author of Blinker), of Dave Kuechler (author of Comix), and others who once frolicked in the land of Clipper.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note: This article is a summary  ( by courtesy of author) original is here.

What is Clipper ?

As a computer software term, the word “Clipper” has two meaning :

1- A programming language

2- A compiler

As a computer programming language that is used to build software programs that originally operated primarily under DOS. Although it is a powerful general-purpose programming language, it was primarily used to construct  database/business programs.

Clipper was originally released in 1985 as a compiler for dBASE III, a very popular database language at the time. Compiling dBASE code changes it from interpreted code, which must be interpreted every time each line of code is executed, to p-code, which uses a Virtual Machine to process the compiled p-code. p-code is considerably faster, but still not as fast as the machine code generated by native compilers. As a technical marketing ploy, the p-code was wrapped into object code (linkable .obj files) which gave the impression that it was compiled to native code. Clipper was created by Nantucket Corporation led by Barry ReBell (political) and Brian Russell (technical), and later sold to Computer AssociatesGrafX Software licensed CA-Clipper in 2002 from CA for ongoing marketing and distribution.

As the product matured, it remained a DOS tool for many years, but added elements of the C programming language and Pascal programming language, as well as OOP, and the code-block data-type (hybridizing the concepts of dBase macros, or string-evaluation, and function pointers), to become far more powerful than the original. Nantucket’s Aspen project later matured into the Windows native-code Visual Objects compiler.

After “swallow” Nantucket at 1992, CA published a few releases of Clipper Compiler, lastly 5.3a at  May 20, 1997. But most of Clipper programmer uses preferably 5.2e – released February 7, 1995.

Although remained a DOS as the compiler, Clipper continues to live as the programming language.

The Clipper language is being actively implemented and extended by multiple organizations/vendors, like xBase ++ from Alaska Software and FlagShip, as well as free(GPL-licensed) projects like Harbour and xHarbour.

Many of the current implementations are portable (DOSWindowsLinux (32- and 64-bit), Unix (32- and 64-bit), and Mac OS X), supporting many language extensions[1], and have greatly extended runtime libraries, as well as various Replaceable Database Drivers (RDD) supporting many popular database formats, like DBF, DBTNTX, DBFCDX (FoxPro, Apollo and Comix), MachSix (SIx Driver and Apollo), SQL, and more. These newer implementations all strive for full compatibility with the standard dBase/xBase syntax, while also offering OOP approaches and target-based syntax such as SQLExecute().

Version history

The various versions of Clipper compiler were:

From Nantucket Corporation; the “seasonal versions”, billed as “dBase compilers

  • Nantucket Clipper Winter’84 – released May 25, 1985
  • Nantucket Clipper Summer’85 – released 1985
  • Nantucket Clipper Winter’85 – released January 29, 1986
  • Nantucket Clipper Autumn’86 – released October 31, 1986
  • Nantucket Clipper Summer’87 – released December 21, 1987

From Nantucket Corporation; Clipper 5

  • Nantucket Clipper 5.00 – released 1990
  • Nantucket Clipper 5.01 – released April 15, 1991
  • Nantucket Clipper 5.01 Rev.129 – released March 31, 1992

and from Computer Associates; CA-Clipper 5

  • CA Clipper 5.01a –
  • CA Clipper 5.20 – released February 15, 1993
  • CA-Clipper 5.2a – released March 15, 1993
  • CA Clipper 5.2b – released June 25, 1993
  • CA-Clipper 5.2c – released August 6, 1993
  • CA Clipper 5.2d – released March 25, 1994
  • CA-Clipper 5.2e – released February 7, 1995
  • CA Clipper 5.30 – released June 26, 1995
  • CA Clipper 5.3a – released May 20, 1996
  • CA Clipper 5.3b – released May 20, 1997

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note: This post is based upon mainly a Wikipedia article :

http://en.wikipedia.org/wiki/Clipper_(programming_language)