Clipper 5 For Windows 7
Do you still have old DOS-Programs based on CA-Clipper running on your system? This Howto shows you, how to speed up those programs by compiling them with hmg.
After you open Snipping Tool, open the menu that you want to capture. For Windows 7, press the Esc key before opening the menu. Press Ctrl + PrtScn keys. The entire screen changes to gray including the open menu. Select Mode, or in earlier versions of Windows, select the arrow next to the New button.
Since the introduction of Windows XP, you probably get a 100% CPU-Usage as soon as you start your exe.
Even if your application is only waiting for user-input, it keeps your computer busy.
I can not fully explain the reason. But Clipper was not designed to be run in a multitasking environment and windows goes through great trouble to emulate a DOS-environment. So now as soon as your old program runs, even the fastest core duo system slows down to a creep. If you run it on a laptop, your batteries are empty quicker than you can say uncle.
But it does not have to be this way.
If you still have your source-code, you are lucky. You can compile it almost without any changes and turn it into an application that looks exactly the same, but runs much quicker and consumes only CPU-cycles when it is doing something.
There are many Clipper compilers out there. Some of them are even free.
Harbour is a great compiler. It will take your Clipper source-code and turn it into C-Code that can be compiled into a binary. You can choose your compiler and there are many libraries that add functions to your program you never dreamt of. It will even run on Linux and Mac-OS.
If you are not interested in Linux and Mac-OS and all the fancy features, you just want an application that installs everything you need. A C-Compiler, binaries and batch files and even a lot of samples.
Such a program exists. It is called 'Harbour MiniGUI', or just 'hmg' for short. Visit the developers website:
http://harbourminigui.googlepages.com/
You can grab the latest version here:
http://www.hmgforum.com/site/
At the time of writing this post, 3.0.22 is the latest version. It is a 20 MB download. Users at hmgforum.com confirm, that it runs well with Windows Vista and Windows 7.
Update: Right now, the current stable version is 3.0.39 if you don't need postgresql-suppprt.
hmg 4.0 ist still in alpha-state. It's goal is to port the windows-api based gui to Qt and make it platform-independent. Be patient. It is not ready, yet.
After you downloaded, the setup file, you can run a regular installer.
I recommend installing it into c:hmg
The installation takes a few seconds. After it is finished, you have everthing you need. Compiler, Linker, Include-Files, etc.
You could compile your prg-files on the command-line, but I prefer the graphical IDE. It gives you a glipse into the many additional features you get with HMG.
Launch the hmg-ide either from the shortcut on your desktop or the startmenu.
Start a new Project.
You can place the project into your existing source-code directory on your harddrive. Make sure, you have a copy in case anything goes wrong.
The IDE creates a new 'Main.Prg' and a new emty form 'Main.Fmg'.
HMG is a great tool to build real Windows-Applications. It is abolutely amazingly simple to turn an existing Clipper-Program into a Windows-Program. But for now, we resist the urge to look at all the shiny features.
All we want to do is compile our console application.
So for now, we don't need the Main.Fmg and Main.Prg. Delete them by selecting them in the Project-Browser and clicking Project - Delete File from the Menu.
Now you have an empty Project. Choose 'Modules' in the Project Browser and click on 'Project' - 'Import File' in the Menu to import your all your prg-files.
The first one you choose will be your main-module. That means, it includes the procedure or function that starts the program. You can declare a module as main by clicking 'Project' - 'Set Module As Main' in the menu.
By default, HMG wants to build a Windows-Application. But your old CA-Clipper-code is a console application.
So you have to tell the compiler to run in 'Console Mode'. You do that in the Project Browser in the Configuration-Tab.
Update: If you are using Version 3.0.39, there is noc 'Console mode' any more in the 'Configuration'-Tab. Don't panik. It still works. Simply add this line to your main .prg-file:
REQUEST HB_GT_WIN_DEFAULT
To be more precise, you now have a mixed-mode program. That means, you can already use windows-gui elements wherever you like.
In some cases, you have to make little adjustments to your code.
Most importantly, harbour looks for a function or procedure 'Main'. If it does not find it, it will not do anything, because it does not know where to start.
Clipper also supported the first function to be named like the .prg-file. So open your prg-file with an editor of your choice and rename the main function.
The old prg-file will be saved in the codepage 850.
My favorite editor is jEdit. It calls the codepage IBM850. If some characters (umlauts, accents, box-drawing-characters, etc.) look funny, click 'File' - 'Reload with Encoding' - 'IBM850'.
Do not change the encoding. Keep it 850 for your console application!
Compile your code by clicking 'Project' - 'Run' in the Menu.
HMG will build an .exe-file and launch it. So if all goes well, your program starts.
The new exe-File is rather large (1-2 MB) compared to an original clipper-exe. But who cares nowadays, right?
Here is a screenshot of a sample console application. As you can see, the wait-command does not keep the Processor busy.
This howto demonstrated, that you don't have to through away your old Clipper code and write it in a new language if you want an application that works well on Windows.
With hmg you can turn it into a modern harbour-console-program for windows within a few minutes.
You can now incrementally modernize your program. You might mant to start by replacing ALERT() with msgbox() to see how well it mixes.
HMG opens a lot of possibilities to really take old application to the 21st century.
I find it very impressive, that Roberto Lopez managed to extend the xBase Language, so that modern GUI-Controls can be defined in an easy to understand way.
Code looks like this:
#include 'minigui.ch'
Function Main
DEFINE WINDOW Win_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 200 ;
TITLE 'Tutor 10 - Picture Button Test' ;
MAIN
@ 10,10 BUTTON PictureButton_1 ;
PICTURE 'button.bmp' ;
ACTION MsgInfo('Picture Button Clicked!!') ;
WIDTH 27 ;
HEIGHT 27 ;
TOOLTIP 'Picture Button Tooltip'
END WINDOW
ACTIVATE WINDOW Win_1
Return
The IDE helps you build this code by designing your forms in a gui-designer.
If you want to know more about HMG, take a look at C:hmgSAMPLES and c:hmgDOChmgdoc.htm (also available online).
I found the people over at hmgforum.com very nice and helpful. They helped me when I got stuck and reading the forum gives a lot of insights.
First appeared | 1985 |
---|---|
Stable release | |
OS | MS-DOS |
Website | www.grafxsoft.com/clipper.htm |
Clipper is an xBase compiler, which is a computer programming language, that is used to create 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.
History[edit]
Clipper was created by Nantucket Corporation, a company that was started in 1984 by Barry ReBell (management) and Brian Russell (technical). In 1992, the company was sold to Computer Associates for 190 million dollars and the product was renamed to CA-Clipper.[1][2]
Clipper was created as a replacement programming language for Ashton Tate's dBASE III, a very popular database language at the time. The advantage of Clipper over dBASE was that it could be compiled[3] and executed under MS-DOS as a standalone application. 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 a lot of applications for banking and insurance companies were developed, here 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.[4]
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, billed as 'dBasecompilers'
- 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
Mac onedrive for business client. 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
Clipper tools[edit]
Additional to a standard clipper library, a notable additional library named Clipper Tools were developed by CA after beginning a Clipper production. Three versions of this library were manufactured. All of them associated with a 5st Clippers version. This library became a de facto standard between a Clipper's clones, such as xHarbour, and it was also cloned for a number of Clipper clones manufacturers.
See also[edit]
References[edit]
- ^'CA-Clipper Viva Clipper !'.
- ^GrafX Software licensed CA-Clipper in 2002 from CA for ongoing marketing and distribution.
- ^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'. thocp.net. The History Of Computing Project. 20 June 2007.
- ^(No data for reference - I was active in the Clipper community and this was what I witnessed at the Clipper conferences.)
- ^'xHarbour.org'. www.xharbour.org.
External links[edit]
- Alaska Software vendor of XBase++
- Print from Clipper to newest Windows printers article
- The Oasis is the largest file archive for CA-Clipper and xBase on the web
- Xailer Integrated development environment for Windows
- Harbour Project A 32/64 bit multiplatform Clipper compiler
- From CA-Clipper to Windows in 5 minutes How to install Harbour MiniGUI and compile a windows-exe.
- DBFree - Xbase/Clipper for the web : Open source, active web pages using server-side Xbase scripts, embedded DBF data engine, based on MaxScript, run on Windows from XP to 10.
- MaxScript xBASE interpreter :the xBASE interpreter for web applications (a.k.a. MAXcp, max Command Processor), freeware, win32 application.
- The NTK Project, WIN32 Gui Framework for (x)Harbour, backward compatible with Clipper and Clip4Win.
- CA Clipper Overview, CA Clipper programming language history and overview.