Array and GET tricks

Array and GET tricks

Design of Clipper

build the truly reusable routine

Data Type Terms

Character :

A special data type consisting of one or more values in the extended character set. Characters can be grouped together to form strings. The maximum size of a character string In Clipper language is 65,534 bytes.

In Clipper, a character data may include any character, including “control” or “unprintable” characters, that are ASCII code less than 32.

Note : Characters with ASCII code 9, 10 and 13 always treated as “white spaces”; this important with EMPTY() and xTRIM() functions.

See Also:  String

Code Block :

A special data type that refers to a piece of compiled program code. In a program, the source code that specifies the creation of a code block.

Data Type :

The category of a data value. A data type is distinguished by the set of allowable values for that type, the set of operators that can be applied, and the storage format used to represent these values. In Clipper language, the following data types are defined: character, numeric, date, logical, array, object, code block, and NIL. Program variables may contain values of any type. Database field variables are limited to character, numeric, date, logical, and a special type called memo which is treated the same as character.

Date Type :

A special data type consisting of digits to store year, month, and day values. Operations on date values are based on chronological values.

Integer :

A number with no decimal digits. Note that Clipper language does not provide a separate data type for integer values.

Literal :

A source code element interpreted literally (as encountered), and assumed to have no abstract meaning. Generally a constant.

See Also: Constant

Logical Type :

A special data type consisting of true (.T.) or false (.F.) values.

See Also: Condition

Memo Type :

A special database field type consisting of one or more characters in the extended character set. The maximum size of a memo field in Clipper language is 65,534 bytes. A memo field differs only from a character string by the fact it is stored in a separate memo (.DBT file) and the field length is variable-length.

See Also: Character String

NIL :

A special data type that has only one allowable value. The special value (NIL) is automatically assigned to all uninitialized variables except publics, and is also passed as a substitute when arguments are omitted in a procedure or function call.

Numeric Type :

A special data type consisting of values that indicate magnitude. Numeric values consist of digits between zero and nine, a sign, and a decimal point.

Objects :

An object is an instance of a class. Each object has one or more attributes (called instance variables) and a series of operations (methods) that execute when a message is sent to the object. The object’s instance variables can only be accessed or assigned by sending messages to the object. Objects are created by calling a special function associated with a class.

See Also: Classes, Instance Variables, Messages, Methods

String :

Generically, a value of type character. In source code, a series of characters enclosed in single or double quotes.

See Also : Character

Substring :

A string within a string, usually to be specified as an argument of a function or command.

Object-Oriented Terms

Classes :

A class defines the variables contained in an object, and the operations applied when the object receives a message. Every object is an instance of a class and responds to messages of that class. Each object, however, has its own copy of the variables specified in the class definition. New objects are created In Clipper language by a calling a special function that begins with the class name followed by the New suffix.

See Also: Instance Variables, Messages, Methods, Objects

Exported Instance Variables :

See : Instance Variables

Instance Variables :

Instance variables are the attributes or the data portion of an object as defined by the object’s class. Each object, when created, is given its own unique set of instance variables initialized to their default values. Instance variables that are accessible are called exported instance variables. Exported instance variables can be inspected and–in some cases–assigned using the send operator. The instance variables of an object persist as long as the object it belongs to.

See Also: Classes, Objects

Messages :

A message is the way an object is requested to perform some action. Messages are sent to an object and composed of the object name, the send operator, and the selector name followed by arguments enclosed in parentheses. The selector has the same name as the method it is calling. Sending a message produces a return value, much like a function call with the return value varying depending on the operation performed.

See Also: Instance Variables, Methods, Objects

Methods :

A method is the operation performed in response to a message sent to an object.

See Also: Classes, Messages, Objects

Objects :

An object is an instance of a class. Each object has one or more attributes (called instance variables) and a series of operations (methods) that execute when a message is sent to the object. The object’s instance variables can only be accessed or assigned by sending messages to the object. Objects are created by calling a special function associated with a class.

See Also: Classes, Instance Variables, Messages, Methods

Self :

An object-oriented term describing a reference to the object that received the current message. In Clipper language, this reference is often the return value of a message send.

Send Operator :

A new operator (:) In Clipper language used to send messages to user interface objects.

Clipper Description

Developed by Nantucket software and released in winter of 1984, first shipping 25 May 1985.

Clipper was a typical database development language and DOS based. Originally is was used as a replacement programming language for Ashton Tate’s dbase II database environment that could be compiled and executed as a standalone application.

Millions of applications were built typically for businesses dealing with small databases like client management, stock keeping. Many applications for banking and insurance companies were developed were the application was considered too small to be developed and run on mainframes. Clipper often served as a front end exactly for the above mentioned mainframe applications and did very well in this area.

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. Libraries were also made by third parties but the programmer could also create its own library or enhance the existing ones.

One of the disadvantages, for commercial developers at least, 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 with a certain code in the source the decompilers would not decompile. But for the hard core hackers no door was kept close.

Around the early 1990’s the users felt a need for a more object oriented environment. Nantucket’s answer was: Clipper 5.0 up to 5.3. This made the Clipper language more sophisticated, but completely OO it never was. Objects and classes could be created but the language needed more, and quickly, should it keep its programmers corps it had created since 1984.

Too late the Nantucket company realized it had to port the Clipper environment to the Windows platform as well and began developing a new project: Aspen: Clipper for Windows. Too late, or at least the research was not given top priority for research and development. In August 1994 (Shipped December 1995) a first version became available and was called: Clipper VO (virtual objects) It was truly windows based but had to cope with many typical first issue bugs that were not explained to the full extend. Again programmers had to build new work arounds and did not feel very comfortable with that idea.

The old stock of programmers however had already switched to Visual Basic (Microsoft) and later Delphi (Borland) This came about because many customers with small database environments wanted to upgrade to window versions in their turn pressured by their clients. And as usual clients wanted their applications yesterday!

A second reason why Clipper never got its previous user base back was that the transition to Clipper VO proved to be too complicated for many senior programmers, and juniors already learned to program in Delphi or VB and later Java.

That was a pity because VO proved to be a very powerful and sophisticated database development tool.

Though Nantucket / CA promised a high degree of compatibility with older developments this did not materialize to the degree to make life easier to former Clipper programmers. The result was that programs were rebuilt in the new environments, the best way to do porting actually. Again slimming down the market for Clipper programmers.

In 1995 Computer Associates bought up the Clipper environment, killed the Clipper DOS version and pre-matured project Aspen, and further developed VO

Other developments for Clipper:

Clipper also could be converted to run on UNIX systems by using a porting tool called Flagship. It runs suitably well.

XBase++ is an OO environment and translates DOS Clipper to Windows but does not enhance the clipper development to an event driven application.

Clip-4-Win is a 16 bit compiler and generated character based applications that ran fairly well within Windows.

Harbour  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

Clipper is still alive!

Chronology:

1984 first issue: Winter 1984

1990 first issue: Clipper 5.0 (distributed at DefCon fall 1990)

1994 first issue of Clipper VO

1997 Clipper VO 2.5

1999 An open source project: Harbour takes up the challenge

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

Note : This post gathered from here.