Identifier length limit

What is variable and field name length limit in Harbour ?

Harbour support long field names without any problem.

TBrowse in Harbour also does not have any 10 character limit.

Variable and field names in Harbour can have up to 63 characters. This limit is defined in hbvmpub.h:

#define HB_SYMBOL_NAME_LEN 63

and can be changed to any bigger value if necessary.

All problems are result of DBASE III DBF format which has 10 character field name limit.

It’s not Harbour problem but DBF structure created many years ago which cannot be changed due to compatibility with other systems using such files.

If you want to use longer field names then you have to chose RDD which uses different low level storage format then DBASE III DBF and supports longer field names.

Przemek

(Source)

DBA : Data Base Assistant

DBA is an imitiative work to the © dBASE III’s Assistant.

It may be an easy tool for people who are familiar to this base architecture of the whole x-Base family.

Many thanks to :

Antonio Linares ( Initiator and first developer of © Harbour ) and

“Le Roy” Roberto Lopez ( Initiator, Builder and Developer of © HMG  ).

Without this two big men and their volonteer coworkers, DBA ( and many others of course) couldn’t be exist.

Download ( setup executable ) here.

Mini Agenda

This is a mini application developed primarily to denote some wonderful features of HMG.

Mini Agenda uses:

– A text (csv)  file for data source and Grid as browse of this file

– DEFINE ACTIVEX for “About” page from a .html file

– HFCL library ( Thanks to S. Rathinagiri for GridPrint )

Features :

– File operations: New, Open, ReOpen, Close, Save, Save as, Print

– Record operations:  Append, Delete, Insert

– Three way ( Natural, Ascending, Descending) sorting columns

– Preserve current item after sort

– In_place editing

– Incremental (and “soft” ) Search

– .ini File for keeping record of last used data file

Download : source, executable.

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.


How I can migrate ?

How I can migrate DOS  to Windows ?

By principle, Harbour  can compile every Clipper Language program; and Harbour applications can run under Windows ( besides many other platforms ) with no problem. This is one of main goals of Harbour project.

Furthermore, Harbour compiled executables will be 32 bit, not 16 😉

Maybe your application include many ( or too many ) .prg file; no problem; (almost) no modification required on your source code; nor extra scripts for compile. ( Thanks to Viktor Szakáts for really wonderful MAKE utility : HBMK2. )

Only  care is :  if “main” prg of your application doesn’t have a “main” module , add one PROCEDURE or  FUNCTION statement to most top of your “main” .prg.

PROC MAIN

That’s all 🙂

You can build your application via HMG by a .bat file (or direct command in the DOS box) such as :

CALL C:\hmg\build.bat /c <mainPrgName>

or via Harbour:

SET PATH=C:\harbour\bin;C:\hmg\mingw\bin;%PATH%
hbmk2 <mainPrgName> -RUN

or the simplest way :

    C:\harbour\bin hbmk2 <mainPrgName> -RUN

( hbmk2 will find all necessary  paths / files 🙂 )

Of course, you need supply name of your main .prg file in place of <mainPrgName>. You may also want to  change  “C:\hmg” and “C:\hmg\harbour” according to your install configuration.

Please be careful about PATH command : If you call the the .bat file from Windows explorer, no problem. If you are working on command (DOS) box, calling repetitively .bat file may cause problem by grown of PATH . In this case you may build a separate .bat for only PATH command and call it only once at beginning of DOS session.

If you want convert a text (console) based application to GUI ( Graphical User Interface ) based Windows application, this is another thing and there isn’t any automatic way for this.  You have need first a GUI library can be used into Harbour. After selecting which library is convenient to your needs and learning  this library, you may begin planing steps of converting process. Writing your application from scratch may be longest but most secure way.

There are links to some articles  about migration in the Links page; looking at this will be useful.

Build a Harbour application

How I can build a Harbour applications ?

Method 1 : By batch processing:

First you have two path definition: harbour\bin and mingw\bin

If  HMG installed in your PC, harbour and mingw directories are already exists. If your HMG root <dir> is c:\hmg, harbour\bin is :

C:\hmg\HARBOUR\bin

and your mingw\bin is

C:\hmg\MINGW\bin

If  HMG not installed or you want use other than HMG folders, you will change paths definitions according to your choice.

Than for this path definitions you will enter (preferably by a  a .bat file ) a command like this:

SET PATH=c:\hmg\HARBOUR\bin;c:\hmg\MINGW\bin;%PATH%

After run this batch file, it’s sufficient a single command for build your application ( in your working directory including <MyProg> of course ):

hbmk2 <MyProg>

hbmk is probably ultimate utility in make area; extremely versatile and extremely successful.

By command window (after changing current directory to harbour\bin or setting path as mentioned below) enter

hbmk2

(without any more world) for short help and

hbmk2 -help

for long one.

More detailed help may find in Harbour Project users’ mailing list.

Method 2 : By hbIDE

( With words of author, Pritbal Bedi) hbIDE, as the name implies, Harbour’s Integrated Development Environment, is an open-source, multi-platform, project. hbIDE is aimed at simplifying the process of project life-cycle comprising, setting-up the project components, editing the sources, building them to final binaries.

You may find more info on hbIDE  herehere and  project home page.

Building Harbour / HMG

How I can build Harbour and / or HMG?

Harbour and HMG both are open source project and it’s possible to (re)build them in your own machine.

But before we need find an answer to the question “why?”.  Both projects has their own binary ( executables, libs, etc ), even setup prg. If you want play on source code, surely you will find building method(s) by digging package.

Making some change in the source code may be educative, useful for understand more deeply the system; but sometime may be also  annoying.

First changing system source files will be risky in general; while changing some place, will be problematic other places, and at least you have make same change repeatedly for every next release of compiler / library.

And second, you have re-build compiler /  library for every change you made.

There is a mymake.bat and win-mak.exe in Harbour package and HMG has buildlib.bat .

And, an excellent tutorial How to build HARBOUR … by an excellent Harbour fan: Giovanni Di Maria.

Anyway, since primary goal is address to beginners, details of this issue is out of scope of this blog.

Five years: A Brief History.

In February 2002 I’ve published the first MiniGUI version.

At that moment, only an experiment whose target for me was research about Harbour-C interface.

A lot of people were interested in the Project and from the beginning collaborated with me in many ways.

Some months later I’ve noticed that the experiment could turn in something more serious.

Being one of my basic targets the easy of use (according xBase spirit) a little time later I’ve added the ‘semi-oop’ interface. That turned the combination of Harbour+MiniGUI in a tool that besides a xBase compiler, offered a GUI, as easy to use as the VB one (yet simpler). This made grow even more the MiniGUI popularity and with it, the problems.

Some people, began an aggressive campaign of lies, pointing not only technical aspects of Harbour and MiniGUI, but personal issues, targeted to create false conflicts in the discussion groups. I let to the readers criteria the theories about the motivations of that people.

This growing brings other problems too. The most serious were the discrepancies about technical issues related with the project direction. Some contributors were not coinciding with my vision of that.

I must accept that could had been solutions for these problems, joining efforts in favor an unique target, but sadly, I don’t knew how to find solution in time.

Today there are two alternative MiniGUI versions besides mine. Yet I’ve wished to find a solution for the differences to make this not happened, that means that the seeding done five years ago, had got results, even much more ahead of my own expectations.

MiniGUI had never existed without its users and contributors and is to them (as every year) my endless gratitude.

Specially to those that got to me the initial impulse, as Grigory Filatov, Jacek Kubica, Ciro Vargas Clemov, Ryszard Rylko (who allow to me to include the HbPrinter code in MiniGUI) and Janusz Pora (I’ve had serious discrepancies with him, but I recognize his enormous efforts and enthusiasm).

For the ‘classic’ OOP defenders that had attacked MiniGUI during years, I want to remember them, that VB turned in the most popular development tool in the world, based in a non-classic scheme for GUI handling, oriented to make things easier for the programmer, let him focus in the problem to solve instead to do it the language complexities. If we are in the xBase world is because this is that we want (or must want). MiniGUI must not be ‘corrected’ to be converted to a traditional paradigm. It is simply an alternative, and as such, we have right to grant its existence.

Regarding the future, It could not be better.

Harbour is in Beta 1, extremely solid and efficient. Surely we have the final version soon.

Regarding MiniGUI, is extremely stable and reliable too. Since I successfully adapted it to work with MingW, we have now with a completely free package (Harbour + MiniGUI + MingW).

Finally, I want to thank to all people that collaborated in some way and whose contributions are documented in five years of ‘changelogs’ and (of course) an special thanks to Pepe Ruano, creator and administrator of harbourminigui.com

There is a lot to do, but I can say with satisfaction that my old dream, a Clipper for Windows free and easy to use, has been reached.

Thanks To All.

Roberto Lopez

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

Note: This article borrowed by courtesy of author.

           Published at :  March 03, 2007 here.