How I have joined HMG Family – A Story
It was in the year 1990, I had seen a computer, first time in my life.
I was a commerce student, studying in a 100+ years old school in my home town Sivakasi (famous for fireworks ), Tamilnadu, Southern part of India. I was studying +2 (12th and final year in school). Once, the exams were over, it was time to join a College. Not to waste the exam holidays, one of my friends had asked me to accompany him for a part time computer course in a near by Polytechnic College. I told him, “Ok”. We joined that course which was for six months, conducted on Saturdays and Sundays. I studied some basics about computers and languages like BASIC, Pascal, COBOL and an introduction to Lotus 1-2-3, Wordstar and dBase III Plus.
After that I had joined a college and my main subject was Commerce. After finishing my Under Graduation degree in the year 1993, I had joined Chartered Accountancy Course. And, once I had finished this course in the year 1996, I joined my brother to manage our family business.
Even though there was a computer in our office, I was not allowed to touch that. The reason was, at that time, computers (AT 386) were costlier and one cannot take the risk of losing precious data and computers were operated only by computer professionals.
In the year 1997, I had purchased a computer on my own, and started implementing something which I had studied some seven years back.
I had studied under the DOS environment and I had got Windows ’95 in my new system as my operating environment. Even though it was easy to operate, I could not do any programming. I had so much of works before hand and I was involved in them for about 1 year. It was a Costing project in Excel with about 150 sheets, everything interlinked. It was a nice experience. I had done some macro programming in Excel for introducing thousand’s comma according to Indian tradition.
In the year 1998, the computer professional who had programmed for the accounting, invoice processing and payroll processing for our business firm had gone for a better job. We could not create new reports according to the requirements and we had to play only with the old options. Only at that time, I had realized about the importance of Database programming. Having the knowledge of DBase III+ programming, I had started to write small utilities to take self configured reports from the existing tables. I had the reference of the source codes for the existing software. It was done in Clipper Summer ’87 version.
There is a saying, ‘Necessity is the mother of invention’. Yes. Necessity had driven me to do more and more programming. Actually, I had started staring huge prg files with various do while .not. eof() loops and virtually indefinite nested if … endif conditions. Once understood, I had the confidence of creating bigger software too. So, in addition to the accounting software, I had created order processing and inventory maintenance and integrated the same with the existing project.
It was in the mid, 1998, I could get an internet connection with a dial up modem. In the mean time, I had a dream of using GUI in my programming. I had tried Visual Basic. I could not link with my existing dbf tables and dropped. In the beginning, I misunderstood about OOPS and GUI. Actually I had an allergy over this OOPS, I don’t know why even now. So, I had abandoned my dream of GUI because of OOPS.
In the year 1999, while searching the net, I had come across a site called Oasis, a site which had shared source code/libraries for Clipper and many utilities. From that site, I had got an excellent library called Super. It had some assembly language routines too to capture mouse gestures and enabled Clipper code to be ‘RAT’ified. Apart from this mouse functionality, the library had so many small utilities like sorting multiple arrays, finding out Day of the week like that. Actually I had realized about the advantages of Open Source on seeing that library source codes. I had studied in depth, and I had known about optimization of codes, effective memory management, different routes to a same destination in programming etc.
With the SuperLib, I had changed all my projects to be mouse enabled, there by satisfying half of my dreams. However, I could not stop dreaming about creating a full fledged Windows program eliminating the dark DOS command box. As new versions of Windows came in the market, I was afraid that, one day there won’t be this DOS Command Box and all my programs would not be useful at all.
I was, why was? even now am, very fond of Open Source. In my system I don’t use any copyright protected software except the Windows Operating System. I would list all the open source software I use in a separate thread for all my requirements.
I had found out Harbour from the Oasis site I had already mentioned. I had tested a lot but could not use it because of SuperLib, as it could not be linked with Harbour.
I was in a confused state. I liked Harbour a lot because of its open nature. I could not abandon SuperLib too, since all of my projects were linked with this library. So, I was desperately searching for a GUI library (at least mouse enabled for Harbour).
On one fine day in my life, my search was fruitful.
I could even remember the date. It was 4th of October, 2002, I had downloaded Harbour MiniGUI and could create a window with my limited xBase programming knowledge. Hurray! I could not describe my feelings in words!
Immediately on compiling my hello world prg, I had commented in the yahoo group from where I had downloaded the 0.40 version of the library with the following words,
It is wonderful to use your Harbour Minigui Library, an open
source library for Harbour.
Thank you very much for your sincere efforts.
I would like to make a small suggestion regarding text boxes.
Shall you please make provision for right aligning the text boxes
for numeric fields?
Thank you once again.
From that day, Harbour MiniGUI page was literally my home page. I read all the messages from various users of the library. It helped me a lot to understand programming, inside out of the library, even about calling C API.
I had happily started to convert all of my projects to HMG. As the product matured, all my projects were fully converted to HMG and I had seen my dream come true.
Most of my programs are used in-house. However, I had created software for many of my friends. I had earned some money from my programs too. As you know, my income is not based on programming, since basically I am a Chartered Accountant and managing business.
I wish to list some of my major HMG projects,
- PyroERP (an ERP software for manufacturing companies with accounting, inventory, order processing,payroll)
- PyroBase (a License maintenance software given to Explosives department, Government of India)
- FACE (Financial Accounting under Computer Environment)
- Interest(ing) Calculator (Calculate interesting part of interest for loans and deposits) – An open source product, hosted in Sourceforge.net.
- FBT Reference (Fringe Benefit Tax referencer)
- Phataka (A Cultural Event maintenance software used by local Rotary Club)
- GSM Calculator
There are many tiny projects too. I am not listing them to show my talents. It shows the simplicity of HMG and my craze on HMG.
It is my nature, to escape from any politics. I wish to be good for all. During July 2005, when Roberto had decided to move on MingW and introduced HMG, MiniGUI Extended product had also born. I didn’t tell a word about anything in the group. I believe in Karma and thought, “if this happens, this is also for the good”.
I had actively participated in the yahoo group up to April, 2006 and kept silence after that.
However, I used HMG in a full fledged manner and I liked MingW version as Roberto distributed them. This is mainly because of the single installation of the whole thing (ie., MiniGUI library + Harbour Compiler + C Compiler) and full utilization of Open Source Software.
All the software projects listed above where developed by me during the period from 2004 till now. I too had contributed some parts like drawing pie graph, alternative syntax (with the valuable guidance of Roberto) (now Roberto had revamped in a better way!), Grid2Print which Roberto has accepted kindly.
Can you believe that this forum had been created in just 2 days time? On 29th of July 2008, I had asked Roberto, breaking my long silence, by an email about the need for a forum exclusively for HMG. Roberto also liked and generously accepted to guide and participate in the forum. On that day itself, I registered this domain hmgforum.com and installed PHPBB forum software and on 1st of August 2008, the forum was officially opened.
I am so HAPPY and PROUD to be part of the HMG family.
Thus, this story has a happy ending.
Courtesy of author, this article borrowed from here.
How I can convert DOS texts to Windows
Probably first step of DOS to Windows migration is converting DOS texts to Windows.
“Text” may be .prg, .txt or anything else plain text files or tables ( .dbf files ) include Character or MEMO type fields.
This operation will be necessary because foreign ( non English ) characters are different in DOS and Windows.
Fortunately we have Harbour functions to use this purpose: HB_OEMTOANSI() and WIN_OEMTOANSI().
Texts files :
cDOS_FName := "MyDOS_xxx.txt"
cWIN_FName := "MyWIN_xxx.txt"
cSourceText := MEMOREAD( cDOS_FName )
cTargetText := HB_OEMTOANSI( cSourceText )
MEMOWRIT( cWIN_FName, cTargetText )
REPLACE ALL TEXT_FIELD WITH HB_OEMTOANSI( TEXT_FIELD )
– Don’t worry about file sizes; 64K limit remain in DOS. However you can use line based processing.
– Recommended :
– Use WIN_OEMTOANSI( ) instead of HB_OEMTOANSI()
– Inverse functions are WIN_ANSITOOEM( ) and HB_ANSITOOEM( )
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).
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.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.
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.
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.
Harbour MiniGUI / HMG is a free / Open Source xBase WIN32 / GUI Development System for Windows platform. By adding this graphical library to Harbour compiler and MinGW, we have now a complete Windows programming tool. In short, Harbour + MiniGUI + MingW is a free Clipper for Windows.
Furthermore this freedom is not about giving up the quality; in contrast, this package has more stability and reliability than many commercial products.
Harbour MiniGUI is aimed to be “natural”. The basic idea lying under it, is to let the programmer to express its ideas in a straight way, using a simple code, easy to write and easy to maintain, making its work more productive. It’s main direction is same as original xBase spirit : being powerful, simple and intuitive.
Harbour MiniGUI license is GPL+”Harbour Exception”, so your use of that executable is in no way restricted on account of linking the library code into it.
Like Harbour, HMG has forks :
Harbour MiniGUI “Extended” ( Parts of this project are based upon: “Harbour MiniGUI” Copyright : Roberto Lopez )
OOHG (Object Oriented Harbour GUI) ( Here comes the graphic (nice) of our applications … MiniGUI (HMG): Windows Library created by Roberto Lopez )
Marinas ( … with a more simple and user-friendly syntax inspired in MiniGUI library created by Roberto Lopez … )