1. What is clipper language?
Clipper is an xBase compiler that implements a variant of the xBase computer programming language. It is used to create or extend software programs that originally operated primarily under MS-DOS. Although it is a powerful general-purpose programming language, it was primarily used to create database/business programs.
A programming language created in 1985.
xBase is the generic term for all programming languages derived from all the original dBase programming language and database formats.
2. History of Clipper
Clipper was created in 1985 as a compiler for dBase III. It was very popular as a database language at the time. Compiling dBase code changed it from interpreted code, which must be interpreted every time each line of code is executed, to p-code, which is used as a virtual machine to process the compiled p-code, is considerably faster, but still not as fast as the machine code generated by native compilers. P-code was a technical market ploy. It was wrapped into object code, which gives the impression that it was compiled into native code.
Clipper was created by Nantucket Corporation, led by Barry Rebell and Brian Russell. Later, it was sold to Computer Associates.
As a product matured, it remained a DOS tool for many years. Still, it added the element of C programming language and Pascal programming language and OOP, and the code-block datatype to become far more powerful than the original.
The language is now being actively implemented and extended by multiple organizations like XBASE++ from Alaska Software and Flagship and a free project like Harbour and xHarbour.
3. Market penetration of Clipper
It was told that the two friends Barry and Brian, were having lunch at a restaurant called “Seafood Nantucket Lighthouse,” discussing how the low processing speed of dBase compared to complied applications was striking. They came up with the idea of creating a compiler and start a company to market it.
Upon its establishment, the Nantucket Clipper is basically proposed to be the best complier for dBase existed.
Nantucket sold well in Western markets. Also, in November 1991, the New York Times reported the company’s success in “painstakingly convincing Soviet software developers that buying is preferable to pirating.” According to the article, Clipper had sold 2,000 copies in the Soviet Union.
In the early 1990s, Clipper failed to transition from MS-DOS to Microsoft Windows under the new ownership. As a result, Clipper was left of the race to the evolution of programming language.
Another reason for the decline of Clipper was that Clipper 5.0 was crashed frequently and unpredictably. Nantucket.
4. Benefit and downside
One of the language’s features: the possibility to link ‘C’ and machine language objects made it a virtual unlimited expandable environment. When you missed a feature, an interface, or whatever you could program, that yourself and the extension made a reusable part of your toolbox. Third parties also made Libraries, but the programmer could also create its own library or enhance the existing ones.
One of the disadvantages for commercial developers was that a clipper executable could easily be disassembled or de-compiled to produce native source code. There were even commercial packages for that. Between the manufacturers of decompilers and Clipper, a covenant was agreed that the decompilers would not decompile with a certain code in the source. But for the hard-core hackers, no door was kept close.
5. Version history
In the years between 1985 and 1992, millions of Clipper applications were built, typically for small businesses dealing with databases concerning many aspects of client management and inventory management. For many smaller businesses, having a Clipper application designed to their specific needs was their first experience with software development. Also, many applications for banking and insurance companies were developed, especially in those cases where the application was considered too small to be developed and run on traditional mainframes. In these environments, Clipper also served as a front end for existing mainframe applications.
Summer 85: in this version, the CLIPPER was fully compatible with the 1.0 version of dBASE III and became very close to him. However, with some additional features like:
- Increased ability to manipulate files and variables.
- Construction of “HELP” to the user; — Multiple relationships between files.
- Creation-of-function user (UDF’s)
- New commands and functions that did not exist in DBASE III.
Winter 85: remained compatibility with dBASE III appeared; however, some implementations, among which the main ones are:
- Indexed variables: vectors.
- Rise of the command.
- New functions for manipulating MEMO fields.
Soon after Winter 85, Clipper was released on the counterattack, the DBASE III PLUS which included the various commands and functions that already had Clipper only with the main novelty. It was able to work in a local network environment.
Fall 86: in this version, the Clipper also went to work in a LAN environment, gained new commands and functions, but many of the new features of DBASE III PLUS were implemented on a provisional basis through auxiliary routines written in C language and Assembly. The compatibility with dBASE III PLUS still existed.
Summer 87: this version takes place two important factors for the development stage of the Clipper:
- Change the C compiler through which it was built.
- Decision to separate once the dbase.
Version 5.0: a trend already observed in version 87 summer confirmed. The compatibility with the language dBase, despite maintained, just became one historical circumstance — the new structure Clipper programming new features based on the structure of the programming language C.
News from version 5.0: many new features that version 5.0 has brought to use are:
- Access to the compiler preprocessor.
- New compiler with more optimized features and options.
-New linker, which enables the creation of dynamic overlays.
- Help “online” for a programmer.
- Definitions of functions for a user.
- More efficient debugger.
- New types and classes of variables.
- Multidimensional Arrays.
6. Who uses it today?
Clipper got a new life with the Harbour project. The Harbour project was started as an open-source project in early 1999. The project is still on. The Harbour programming language is a superset of the well-known x-Base language, often referred to as Clipper. Harbour is 100% backward compatible with the Clipper Language, yet it adds many modern features and tools comparable to today’s leading compilers. Out of the harbour project, xHarbour (extended Harbour) was started late 2001 as a fork off of the Harbour Project.
As of 2005, the Clipper language is being actively implemented and extended by multiple organizations/vendors, free (GPL based) like Clip, Harbour, xHarbour, and commercial compilers like Xbase++, FlagShip.
Many of the current (2005) implementations are portable (DOS, Windows, Linux (32,64), Unix (32,64), OS/X) and support many languages syntax extensions, and greatly extended Run-Time libraries, as well as various Replaceable Database Drivers (RDD) supporting many popular database formats, like DBF, DBTNTX, DBFCDX (FoxPro, and Comix), MachSix (Apollo), SQL, and more, all compatible with the standard dBase/xBase syntax, while also offering OOP, approaches, as well as target-based syntax such as SQLExecute( … ), etc.
Some existing Clipper applications remained in active use for ten or fifteen years, requiring regular maintenance. Around 2015, the number of Clipper applications that still saw daily commercial use was minimal.
7. Example of Code
Example of IF Statement:
Iconditon1 is a logical control expression. If it evaluates to true (.T.), all following statements are executed until an ELSEIF, ELSE, or ENDIF is encountered.
ELSEIF Iconditon1 identifies statements to execute if the associated condition evaluates to true (.T.) and all preceding IF or ELSEIF conditions evaluate to false (.F.). Any number of ELSEIF statements can be specified within the same IF…ENDIF control structure.
ELSE identifies statements to execute if the IF and all preceding ELSEIF conditions evaluate to false (.F.).
LOCAL NUMBER := 0
IF nNUMBER < 50
? ”Less than 50”
ELSEIF nNUMBER = 50
? “Is equal to 50”
? “Greater than 50”
Example of Loop Statement:
[DO] WHILE <lCondition>
lCondition is the logical control expression for the DO WHILE loop.
EXIT unconditionally branches control from within a DO WHILE or FOR…NEXT structure to the statement immediately following the corresponding ENDDO or NEXT statement.
LOOP branches control to the most recently executed DO WHILE or FOR statement.
LOCAL cOldSalesman, nTotalAmount
USE Sales INDEX Salesman NEW
DO WHILE .NOT. Eof()
cOldSalesman := Sales->Salesman
nTotalAmount := 0
DO WHILE cOldSalesman = Sales->Salesman ;
.AND. (.NOT. Eof())
? Sales->Salesman, Sales->Amount
nTotalAmount := nTotalAmount + Sales->Amount
? “Total: “, nTotalAmount, “for”, cOldSalesman
This code fragment demonstrates how LOOP can be used to
provide an intermediate processing condition:
DO WHILE <lCondition>
IF <intermediate condition>
This example demonstrates the use of DO WHILE to emulate a
repeat until looping construct:
LOCAL lMore := .T.
DO WHILE lMore
lMore := (<lCondition>)
This example uses a DO WHILE loop to move sequentially through
a database file:
DO WHILE .NOT. Eof()
In summary, Clipper is an xBase compiler that implements a variant of the xBase computer programming language. It is used to create or extend software programs that originally operated primarily under MS-DOS. Although it is a powerful general-purpose programming language, it was primarily used to create database/business programs.
The Clipper allows dynamic applications with data files, making them easier and faster than those developed in a traditional programming language such as COBOL, Basic, or Pascal. A simple and efficient programming language allows the orders and logical links to quickly enable the definition of programs with a high degree of complexity.