Showing posts with label CCH. Show all posts
Showing posts with label CCH. Show all posts

Tuesday, July 12, 2011

How to Convert a Clipper 5.2e application to Harbour

This article is written in in response to a comment left on Clipper... Clipper.. Clipper by Terry Carrol on 3rd July 2011 who asked

I’d like to know if there is an easy migration from Clipper to something else that I could make my Clipper program work on a 64-bit machine..."

As you are probably aware, Clipper apps being 16-bits cannot run on 64-bits Windows 7. For it to do so, it must be converted to 32-bits by using the Harbour or  xHarbour. I had previously show how to do so in Migrating from CA-Clipper 5.2e to xHarbour (Part I), a 3-part series. So this article focuses on using Harbour 2.1

Step 1 - Convert your Clipper link (*.lnk) file to  Harbour Project File (*.hbp)
Step 2 - Use Hbmk2 to compile the .hbp file

Step 1

1.1 Let us start by looking a Blinker link file of one of my actual Clipper project

BLINKER INCREMENTAL OFF
BLINKER EXECUTABLE COMPRESS
BLINKER EXECUTABLE CLIPPER F99
BLINKER PROCEDURE DEPTH 70
BLINKER OVERLAY OPSIZE 30
STACK 7168

FILE FC_MAIN
OUTPUT FASCALL

BEGINAREA
    FILE WRPT_GLL
    FILE WRPT_ARL
    FILE WRPT_ARD
    FILE WRPT_ARS
    FILE WRPT_APL
    FILE WRPT_APD
    FILE WRPT_APS
    FILE \KSLIB\CLIPLIB\UTILITY

    FILE \CLIPLIB\COMIX\CLIPMORE\52\CM52.OBJ
    ALLOCATE \CLIPLIB\COMIX\CLIPMORE\52\CM52
    FILE \CLIPLIB\COMIX\COMIX\52\CMX52.OBJ
    ALLOCATE \CLIPLIB\COMIX\COMIX\52\CMX52
ENDAREA

LIBRARY CLIPPER
LIBRARY EXTEND
LIBRARY DBFCDX
NOBELL


1.2 Convert the fascall.lnk to fascall.hbp

-ofascall4w7.exe
-w0
-es2
-rebuild

fc_main
WRPT_GLL
WRPT_ARL
WRPT_ARD
WRPT_ARS
WRPT_APL
WRPT_APD
WRPT_APS
UTILITY

Step 2


hbmk2 FASCALL.HBP

Result

You are bound to have a number of unresolved Externals, ie functions not supported by Harbour.
Once you have found alternative functions, FASCALL4W7.EXE, a true 32-bit executable will run on Windows 7 64-bits.

That's it :-)

Sunday, March 13, 2011

Does a Smaller EXE size equates to Better Execution Speed ?

Recently, I had discovered that an EXE created by Minigui+Harbour 2.1 was 800K smaller than an EXE created with HMG+Harbour 2.0. A series of discussion with Viktor and Grigory Filatov confirmed that the smaller EXE was due to the usage of Borland C Compiler by Minigui as compared with MingW32. But it does not end here :-)

Viktor as well as Gustavo of the Minigui forum convinced me that a smaller EXE does not mean faster execution.

1) Gustavo Asborno
Hi Chee Chong Hwa, The size difference between HMG and Miniguide be only the compiler, HMG uses Mingw, which creates larger exes, but is superior in speed, while loading windows.

2) Gustavo Asborno
Hi CCH, I mean in the execution, for example if we have a window with many controls in an ABM my case, there are 98 in a Textbox Tab, at the beginningof the ABM and the controls are going dabdole Enabled: =. F. Borland is avisual effect of this work with Mingw this is not reflected, the load is instantaneous.

3) Viktor
Yes, bcc produces smaller but much slower exes. bcc is by far the slowest of all Windows C compilers.

4)CCH: BTW, don't you think that is a paradox that a smaller EXE executes slower  than a bigger EXE ;-)

Viktor :
It may be surprising at first, but this is a classic optimization problem. In most C compilers you
must chose between size and speed (and there is usually some balanced optimum in between).

F.e.:
 FOR tmp := 1 TO 5
    ? tmp
 NEXT
is smaller, but slower than this:
 ? 1
 ? 2
 ? 3
 ? 4
 ? 5

This is called loop unrolling optimization, and just one of the many possibilities.

5. CCH :So it is not only a launch time issue but execution throughout the app ?

Viktor : 
It's execution speed.

[ Raw launch time is mainly influenced by other things, like storage
medium, number of .dll dependencies, exe compression. Plus of
course any application level init code, which is affected by execution
speed. ]

So, it would appear that it may be worthwhile to try recompiling the mingui.lib using MIngW32 :-)

So the next article would be to let Walter Formigoni to teach us how to do so

Monday, March 7, 2011

Habour 2.1 now supports Alert() mapped to MessageBox()

Great news ! In scanning the ChangeLog dated 22nd Feb 2011 that came with HB2.1, i found this gem


2011-01-10 20:02 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rtl/gtgui/gtgui.c


+ added basic support for redirecting ALERT() to MessageBox() in
MS-Windows GTGUI builds. Please remember that MessageBox() supports
only few predefined buttons so it's not possible to show all user
options. Anyhow it should be enough to present error messages
generated by default error handler.


I am sure you know what this means to Clipper programmers migrating their codes to Harbour :-)

Just tested Alert() as in :-

nchoice := Alert( 'Print or Display &mreptname', { 'PRINT', 'DISPLAY', 'CANCEL' } )

Observations
============
1. Can handle up to 3 buttons. If a 4th button is added to the array of choices, only 1 button will show up

2. No Window title
3. No Icon

Wednesday, February 23, 2011

How to Build a Minigui (HMG Extended) Application with hbmk2 (Hb2.1, rc2)

Let us see what I have achieved thus far using hbmk2 from  the Harbour 2.1, rc (rev 16348) nightly builds as well as the MinGW Compiler

1. Harbour 2.1 + gtWVT - succesful
2..Harbour 2.1 + gtWVG- succesful
3. Harbour 2.0 + HMG.3.0.35 - succesful
4. Harbour 2.1 + HMG.3.0.35 -failure as HB2.1 not supported by HMG

With the help of Grigory Filatov of Minigui(HMG Extended) and Viktor (hbmk2 Architect), I have finally managed to do the same with the latest version of Minigui +Harbour 2.1, rc2
Please not that in this case, the MinGW linker could not be used as Borland C++ Compiler was used to build Minigui.

The successful re-building of a legacy 16-bit FiveWin application was done using the free Borland C++ Compiler +Harbour 2.1, rc2 +Minigui using the following .hbp and .hbc files

HRM4HMGX.HBP-oHRM4HMGX.exe
-w3
-es2
-gtgui
-rebuild

-lminigui -lvfw32
-lhbct -lhbmzip -lminizip -lhbwin -lhbmisc -lxhb

HRM4HMGX.HBC

hrm4win.prg
locks.prg

HRM4HMGX.HBC
incpaths=C:\MiniGUI\include
libpaths=C:\MiniGUI\lib
libs=
gt=
mt=no
instpaths=

Saturday, February 19, 2011

Simple Usage of gtWVT

What is gtWVT ?

gtWVT is the  GT driver for MS-Windows (Win 95 and higher) and was contributed to Xharbour on 22nd December 2003 by Peter Rees

It creates its own GUI window instead of using MS-console window. It allows to changes to font, window size, etc.

gtWVT is a pure console implementation of traditional Clipper terminaltaking Windows API as its base console IO protocols. Its OI are  rendered in a Windows window and hence all of MSDN is available  for use with GTWVT.


Simple Usage in Harbour/xHarbour

Incredibly as it may seems, just adding -gtwvt to yourproject.hbp and then hbmk2 yourproject.hbp will allow your newly recompiled CA-Clipper Codes (as Harbour Codes) to run  as a true 32-bits application to run in its own GUI window rather than the awkward Command Prompt Window :-)

gtWVT also supports  additional functionality with hb_gtInfo() interface. You may want to check out harbour\include\hbgtinfo.ch :-)

Thursday, February 17, 2011

How many changes since Harbour 2.0 ?

Recently, I downloaded hb2.1 and found that it does resolve some of the issues I faced in recompiling XHarbour apps circa 2006 to Harbour 2.0. For example, pressing ESC when in a memo field  DBEDIT() did not work in hb2.0 even when I made no changes.

Do you know how many changes that has been made since hb2.0 ? Would you believe that more than 3,000 changes have been made. Check out this excerpt of the response from Viktor on my request for hm to provide me a list of changes since hb2.0

Viktor - 16/1/2011
=============

Phew... for this I'd need to spend many long days to gather all changes (from ChangeLog) and translate them to some digestible terms. I had actually asked dev list members to do it, but there was barely any help.

In fact this job was not even finished for 1.0 -> 2.0 changes, there were so many of them. Now there are 3000 more changes since 2.0, so, it should be made community effort in some ways. I agree it's very good idea and very important to get such list.

CCH: Perhaps, I should start to wade through the ChangeLog and start posting on this blog :-)


Wednesday, February 16, 2011

Free xEdit IDE from xailer.com


From the News of Xailer.com  billed as the Ultimate Development Environment for Xbase

01-19-2011. New xEdit 2.2 version
New upgrade of our free development environment for [x]Harbour xEdit. Now with subprojects support. You may find further information on the downloads section.


Just downloaded the 2011 version of the free xEdit2 IDE (xeditsetup.exe) from http://www.xailer.com.

Installation was a breeze on my Windows 7 Home Premium Notebook but the  Desktop Shortcut did not appear :-)

1. Click New Project and presented with Project Properties

2. Tree-like project Properties covering
a)Main (Project Type, Description, Output File, Environment, Main Module)
- Empty pulldown for environment
- populated after Add file to Project

b) Look (inlclude XP Themes, Select Icon)
c)Version
d) Options
e) Libraries
f) Directories (Root, Source, Include, Resource, Object)

3) Click Projects/Add File to Project

4. Click Compile, no issue here

5. Click Run
- No error messages, no compile errors but no EXE created

6. Updated Tools\Programming Environment with Harbor 2.0/MinGW and updated Project Properties\Environment

7. Click Run
- No error messages, no compile errors but no EXE created

Hmm... I think I am missing something here :-)

Have emailed Xailer Forum/Google Group owners and awaiting reply.

As at 21st Feb 2011, still unable to create EXE using xEdit2, please refer to this thread :-(

More to come...

How to compile a HMG application with hbmk2 ?

All along, I have always use HMG-IDE by Roberto Lopez to compile  Harbour Minigui  Win 32 apps. The process is actually simple. For example, all I needed to do was to create a project with the IDE and add  a list of the PRGs that needed to be compiled.

If the name of the project is FRS4HMG, frs4hmg.hbp will be created as follows :-

frs4hmg.hbp
=========
frs4w764.prg
lock.prg

By running the frs4hmg project, FRS4HMG.EXE is created

After discovering the versatility of hbmk2 and especially after successfully using hbmk2 to compile a gtWVG app, I was motivated to try the same with building a HMG app with hbmk2.

I took a look at the frs4hmg.hbp and noticed that there was no HMG libs at all. I then looked at the build.bat in the HMG root folder and was overwhelmed :-) As usual, I posted my issue at the HMG Forum and an Italian Member, Luigi was kind enough to walk me through and highlight that it was just impossible to do so with Harbour 2.1


Quote by Luigi

In addition, I have tried to compile HMG3 with the new version of the Harbour compiler but I got many warning with the option /w0 (with /w3, of course, does not generate the hmg library). The generation of an executable is, in any case, impossible for many mistakes: for example with hbmzip (used by Hmg).

frs4hmg.hbp (after looking at Luigi's feedback)
=========

-oFRS4HMG.exe
-prgflag= -w3 -es2 -gtgui
-cflag=-O3

-lhmg -lhbmzip -lhbwin -lhbct -lhbmisc -lxhb -lvfw32 -lmsvfw32

frs4hmg.hbc

frs4w764.prg
locks.prg

frs4hmg.hbc
=========

incpaths=c:\hmg\include
libpaths=c:\hmg\lib


I then hbmk2 frs4hmg.hbp but there were lots of undefined functions in lhmg etc.

Taking the cue, I changed the PATH under environmental variables in Win 7 to C:\hb20;Hb20\bin and

hbmk2 frs4hmg.hbp and bingo FRS4HMG.EXE was duly created !

Tuesday, February 15, 2011

Migrating Xharbour Codes to Harbour 2.1

Recently in recompiling a XHarbour app to Harbour 2.1, I ran into a couple of Undefined Functions such as

1) C:/Users/CCH/AppData/Local/
Temp/hbmk_lv5w33.dir/HMS_MAIN.o:HMS_MAIN.c:(.data+0x1
5b8): undefined reference to `HB_FUN_SETMOUSE'

2) C:/Users/CCH/AppData/Local/Temp/hbmk_lv5w33.dir/HMS_MAIN.o:HMS_MAIN.c:(.data+0x1
6b8): undefined reference to `HB_FUN_HB_FREADLINE'
I tried unsuccessfully to find replacement functions and Viktor came to my rescue by suggesting that Ilink xhb and hbxpp libs to your app:  hbmk2 ... xhb.hbc hbxpp.hbc

Practically, it means that I add xhb.hbc and hbxpp.hbc to my hbp file :-)

Monday, February 14, 2011

Building a Harbour+gtWvg Project using hbmk2

Previously, I had written how one can build a Harbour+gtWvg project using XMate, the first part at
http://cch4clipper.blogspot.com/2009/04/using-harbourwvg-part-i.html

Having discovered the simplicity of using hbmk2 to compile a 32-bit version of DBU which runs in a true 32-bit Window, I tried to rebuild my previous gtWvg project. I succeeded to generate an EXE but on launching, it just starts and exit straightaway.

Fortunately. Pritpal came to my assistance and suggested adding  the following to FAS4WVG.HBP

-inc
-mt
 -w3
-es2
-gtwvg
-gui

and Hip Hip Hooray, I can now build a Harbour+gtWvg project without an IDE :-)

Saturday, February 12, 2011

What is hbmk2 ?

hbmk2.exe is the Harbour 2.0 excellent make utility that is located in the BIN folder under the C:\hb20 root directory. This is assuming that you accept the default location when installing the hb20 distro available at http://sourceforge.net/projects/harbour-project/files/binaries-windows/2.0.0/

After installing do not forget to set path to c:\hb20; c:\hb20\bin.

To use it is fairly simple, go to your project folder and type

c:\hb20\projects\yourproject >hbmk2 yourproject.hbp and bingo your Harbour 32-bit EXE is created

What are the options that hbmk2 provide ?

Just type at any command prompt

C:\hb20\projects\myprojects> hbmk2  
and this is what you get to see :-

Harbour Make (hbmk2) 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, Viktor Szakats
http://www.harbour-project.org/

Syntax:

  hbmk2 [options] [] .clp|.d]> Options:   -o        output file name   -l        link with library. should be without                      path, extension and 'lib' prefix (unless part of libname).   -L        additional path to search for libraries   -i
|-incpath=
additional path to search for headers
  -static|-shared    link with static/shared libs
  -mt|-st            link with multi/single-thread VM
  -gt          link with GT GT driver, can be repeated to link with
                     more GTs. First one will be the default at runtime
  -hblib             create static library
  -hbdyn             create dynamic library
  -help|--help       long help
 

For more details, see http://groups.google.com/group/harbour-users/web/how-using-hbmk2

Sunday, May 3, 2009

Reporting with HMG : Part II

In the previous article Reporting with HMG : Part I, I had shown you how easy it was to code a report using HMG's DO REPORT command.

But what should you do if you have the need to customise your standard application reports for different customers and yet maintain only one executable ?

In this respect, HMG allows you to define and even edit a report format using any text editor (including Notepad) and then print within your Harbour+HMG application without recompiling.

Here is how to achieve the above :-

#include 'minigui.ch'

procedure main()
//
define window MainForm ;
at 0,0 ;
width 100;
height 100 ;
title 'FAS4HMG' ;
main

DEFINE MAIN MENU
POPUP 'File'
ITEM 'Print GL Chart of Accounts ' ACTION PrintExternalGlChart()
END POPUP
END MENU
end window
//
activate window MainForm

Return Nil

function PrintExternalGlChart()
cClient:='Clipper... Clipper... Clipper'
use GLAC
index on glcode to printexternalglchart
go top
DO REPORT FORM GlChart
use
return


GlChart.rpt

DEFINE REPORT TEMPLATE
TITLE 'GL Chart of Accounts|' + cClient
HEADERS {'',' ',' ',' '} , {'GL CODE','GL NAME','GL GROUP','GL TYPE'}
FIELDS {'glcode','glname','glgroup','gltype'}
WIDTHS {10,40,20,10}
TOTALS {.F.,.F.,.F.,.F.}
NFORMATS { , , ,}
WORKAREA glac
LPP 50
CPL 80
LMARGIN 4
PREVIEW
SELECT
IMAGE {'client.jpg', 0,1,1,1 }
GROUPED BY 'GLGROUP'
HEADRGRP 'GL Group:'
END REPORT



More to come..

Reporting with HMG : Part I

It is amazingly easy to create and print reports using HMG...

All you have to do is as follows :-

#include 'minigui.ch'

procedure main()
//
define window MainForm ;
at 0,0 ;
width 100;
height 100 ;
title 'FAS4HMG' ;
main

DEFINE MAIN MENU
POPUP 'File'
ITEM 'Print GL Chart of Accounts ' ACTION PrintGLChart()
END POPUP
END MENU
end window
//
activate window MainForm

Return Nil



function PrintGLChart()
//
use GLAC
index on glcode to printglchart
//
set date british
set century on
//
DO REPORT ;
TITLE 'GL Chart of Accounts' ;
HEADERS {'','','',''} , {'GL CODE','DESCRIPTION','GL GROUP','GL TYPE'} ;
FIELDS {'glcode','glname','glgroup','gltype'} ;
WIDTHS {10,40,20,10} ;
TOTALS {.F.,.F.,.F.,.F.} ;
NFORMATS {'','','',"} ;
WORKAREA GLAC ;
LPP 50 ;
CPL 80 ;
LMARGIN 2 ;
PAPERSIZE DMPAPER_A4 ;
PREVIEW ;
SELECT ;
MULTIPLE ;
GROUPED BY 'glgroup' ;
HEADRGRP 'GL Group'
//

Return Nil


After Clicking Yes


After Choosing Thumbnails



If the above-mentioned codes are recompiled with MiniGui ie HMG Extended




Next : Reporting with HMG : Part II

Tuesday, April 14, 2009

Can GTWVG work with xHarbour ?

CCH : I have been asked quite a few times as to whether GTWVG will compile with xHarbour.
Initially, I thought why not as Ron Pinkas was the one who mentioned about WVG in a response to me in the xHarbour Builder News Group. At that time, I was using the September 2008 Edition of xHarbour.com distro.

Today, Sudip Bhattacharyya revealed an email discussion with Pritpal regarding this matter.

Q. Is there any way to use xHarbour+wvg?

QUOTE by Pritpal Bedi

WVG as of now is not compilable with xHarbour. It is multi-windows, multi-threaded approach and some very fine new concepts which are only available in Harbour.

I had ported WVG to xHarbour but about 1.5 years before. That version is workable but you have to compile it with your own tools. Just look for xharbour/contrib/gtwvg folder in CVS.

Due to its limitations I am not contributing to xHarbour any more.

UNQUOTE

Sunday, April 12, 2009

How to create a new window with Harbour + WVG ?

Having gained the confidence of simple guifying of FAS4WVG without breaking codes and the sheer joy of not having to rewrite tonnes of codes due to the extensive use of ALERT(), I explored on how to create a new window from within the Main Console Window.

Based on my understanding, you can create and ultimately destroy a new Window by making a function call such as :-

MyNewWindow('Reindexing','MyIcon','N/W')

#include "hbgtinfo.ch"

FUNCTION MyNewWindow(cWindowCaption,cIconFile,cColor )
LOCAL oCrt
oCrt := WvgCrt():New( , , { -4,-4 }, { maxrow()-4,maxCol()-4}, , .t. )
oCrt:lModal := .T.
oCrt:icon := cIconFile
oCrt:create()
oCrt:resizable :=.T.
SETCOLOR(cColor)
CLS
// Needs #include "hbgtinfo.ch"
hb_gtinfo(HB_GTI_WINTITLE,cWindowCaption)

/* Your Clipper Codes goes here */

oCrt:destroy()

RETURN nil

Using Harbour+WVG +xMate - Part IV - CONCLUSION

From Part III of this series of articles, this is what I have achieved thus far.


How about adding features to the Console Window itself ?

This is how you change the caption and application icon :-

//This ensures that window is physically existent when any operation on console are requested.
CLS

// Add icon
hb_gtInfo( HB_GTI_ICONFILE, "ksred.ico" )

// Add Window Caption
hb_gtInfo( HB_GTI_WINTITLE, "FAS4WVG - Clipper... Clipper... Clipper" )


Is there a GUI Alert() that is fully compatible with CA-Clipper Alert() ?

Why not, with Pritpal's excellent programming skills, ALERT("Reindex ALL Files ?, {"No","Yes"}) gives you this Windows Dialog :-

Isn't this what you would have expected ?

Please note that the GUI Alert() available in the April 2009 Edition of xHarbour.com distro simply maps to MessageBox with OK as the only option. So if your code is nChoice:=ALERT("Reindex ALL Files ?, {"No","Yes"}), Pressing OK will never Reindex !

You will have no such issue with Pritpal's Harbour Ready to use Distro.


Actual Reindexing in action ...

The above was achieved using wvg_BoxRaised(), wvg_BoxRecessed() and wvgBoxGroupRaised().

CONCLUSION :

To quote Pritpal from one of of his email response

" GTWVG is meant to update your Clipper code to have Windows look and
feel without any code changes, just addition of few lines. If it were to mimick exact
GUI behavior then there are many other options, but you end up writing practically
everything, which is simply difficult if not impossible.

This is a matter of focus. "

What do we wish to achieve for our keyboard-loving customers ?

Well, we need to break the DOS barriers and avoid the need for the customers to be retrained in their daily usage of their mission-critical applications.

So, if you wish to avoid lots of re-programming your Clipper Codes and only want to provide your keyboard-loving customers with a simple GUI but clearly 32-bits Windows solution, IMHO, Pritpal's Harbour Ready to Use Distro that includes Harbour +WVG +xMate is the way to go...

If your needs are more onerous, may I suggest HMG or HMG Extended ?

Good Luck !

BTW, this is the final part of Using Harbour+WVG +xMate but I will continue to write on my experience with Harbour Ready to Use + GTWVG aka WVG


Saturday, April 11, 2009

Using Harbour+WVG +xMate - Part III

As you may recall from Part II, using Pritpal Bedi's Harbour Read to use Distro, I had successfully built FAS4WVG, a pure Win32 executable which does not run in a Command (DOS) Window.

Now, lets guify the DISPBOX() surrounding Main Menu & Messages by replacing

dispbox( 1, 0, 3, 79, B_DOUBLE )
dispbox( 22, 0, 24, 79, B_DOUBLE )

with :-

Wvg_BoxGroupRaised( 2, 1, 2, 77)
Wvg_BoxGroupRaised( 23, 1, 23, 77)

// Instruct GT to Repaint the Screen with GUI elements
Wvt_InvalidateRect( 0, 0, maxrow(), maxcol() )

The result is as follows :-


I then changed the default color to GREY to accentuate the 3D look and feel and added a
Wvg_BoxGroupRaised( 4, 1, 20, 77) for a centralised work area



You can see the DBEDIT() within a Boxraised(4,1,20,77) as follows :-


Same DBEDIT() but within a WVG_BoxRecessed

Same DBEDIT() but within a WVG_BoxRecessed() & WVG_BoxGroupRaised()



Next on Part IV

Friday, April 10, 2009

Using Harbour+WVG +xMate - Part II

If you recall from my previous article, this is what we got after recompiling with the Harbour Ready to Use Distro by Pritpal Bedi :-


Pretty disappointing, huh ! What you are looking at is a true 32 bit Windows application in a DOS window but how to convince your clients that this is indeed a Win32 executable ? This is where Pritpal Bedi comes to the rescue with his WVG library.

So where do we start to guify our Win32 'DOS looking" executable ?

This is what I have done, JUST add right after MAIN()

HB_GTSYS()

where

Function HB_GTSYS()
REQUEST HB_GT_WVG_DEFAULT
REQUEST HB_GT_WVT
REQUEST HB_GT_WGU
Return NIL

That's it !


Notice that the caption now shows FAS4WVG and not the Dos Prompt + path to FAS4WVG.
Hip... Hip... Hooray, no more DOS window !

Next on Part III

Thursday, April 9, 2009

Using Harbour+WVG +xMate - Part I

Using Harbour+HMG or HMG Extended is great but I still needed to provide a solution to quite a number of my existing users who prefer to use our apps in text mode but yet Win32 ready.These users just love to use the keyboard and loathe to use the mouse :-)

I did consider using WVW but since Budyanto does not have time to update his great GUI library, I decided to take a serious look at Harbour + WVG.

After playing with the xMate that came with Pritpal Bedi's Ready to use Harbour Distro, I finally managed to compile and build a Harbour+WVG version of FAS4DOS codenamed FAS4WVG. This is what I have done :-

1. Installed Pritpal's Ready to Use Harbour which resulted in a folder being created ie
c:\harbour_dev with the following sub-folders
dev_exes
dev_libs
dev_projects
dev_sources
harbour
mingw
xmate

2. I then copied the previously converted FAS4DOS codes (from 5.2e to xHarbour) into a new folder FAS4WVG under the dev_projects folder. I did this in order to save time as all UNRESOLVED EXTERNALS had already been dealt with as per my previous articles "Migrating from CA-Clipper 5.2e to xHarbour Part I, II & III "

Please note that there is also a default demowvg folder already there for your reference.

3. Moving to the xMate Directory, I launched xMate and created a new Project


4. What is important here is to choose
a) Project Type, default Executable
b) Environment (wvgMINGW, wvgBCC, wvgMSC, wvgWATCOM)
Nb. Only MINGW comes with this Pritpal's Distro
c) You may also choose to Import based on a Clipper Blinker/Exospace link script

5. Click OK and
a) Input Project name, in my case FAS4WVG
b) Input HOME Folder (where your project files reside)
c) Add Project Files


c) Save and both the XMate Editor and Project Manager are launched


6. Under the xMate Project Manager, you can choose to :-
a) Build Project
b) Build and Launch Project
c) Rebuild Project
d) Rebuild and Launch Project
e) Launch Project
f) Compile single source
g) Compile all sources

7. I then clicked (b) and starting getting errors mainly due to ambiguous references relating to getlists which I resolved by adding LOCAL getlist:={}

8. Then, I got the 'FATAL : Unknown Error - Check Output Console'

9. I then clicked the icon that had a ? over it and saw that I had a few errors such as
a) Unresolved external references
b) Duplicate decalarations

By checking to my original Blinker Link Script, I realised that I had inadvertently left out a prg whilst including a couple of redundant prgs.

10. Once resolved , bingo, FAS4WVG was finally built and launched


Next to add GUI features ...

Thursday, April 2, 2009

What is xMate ?

CCH: I finally found time to start playing with Pritpal Bedi's Harbour + WVG. His distro came with xMate. In the beginning, I was a bit stumped on how to use xMate and then I clicked on Online Manua and this is what I got :-

xMate is intended to be primarily used with [x]Harbour and Clipper compiler, to create, manage, update, and build the software development projects.

It is aimed at building Windows oriented software, be it GUI or console applications and libraries.

Getting started fast

You can start creating and managing your new and existing projects within seconds, provided that your compilers are installed in default directories with the default directory tree and all necessary files are in places.

Initially you just need to verify if the environments that you have are suited to your project, and that the installations paths as described in the environment reflect the installation on your computer. This and potentially any further maintenance of the environments needs to be done only once. When done, you will never need to return to those more technical aspects of xMate.

The sample environments that xMate is shipped with, should be ready to use unaltered on most systems. Please refer to the Environment Configuration topic for detailed help of the xMate environments.

Once the environments are confirmed. All you need to do is to provide the name and location Of your project (s) and drop all the project files into the project configuration window, click on“Build and Run” button, and your application will come to life in seconds.

It is that simple.

The big advantage of xmate is that its project and environment files are portable, and can be transferred from one PC to another, together with the project files, and continue working correctly.

Welcome to Clipper... Clipper... Clipper


In 1997, then using Delphi 3, I had already created 32-bits Windows applications for HRIS, ERP and CRM. In 2007, using Ruby on Rails, an AJAX powered CRM site running on Apache & MySQL was created and I am now using Visual Studio .Net 2008 to create web-based projects and Delphi 7 for Win32 applications using SQL2005 & DBFCDX.

So, why then am I reviving the Original Clipper... Clipper... Clipper via a Blog as CA-Clipper is a programming language for the DOS world ? Believe it or not, there are still some clients using my mission-critical CA-Clipper applications for DOS installed in the late 80's and up to the mid 90's. This is testimony to CA-Clipper's robustness as a language :-)

With the widespread introduction of Windows 7 64-bits as the standard O/S for new Windows based PCs & Notebooks, CA-Clipper EXE simply will not work and it has become imperative for Clipper programmers to migrate immediately to Harbour to build 32/64 bits EXEs

Since 28th January 2009, this blog has been read by 134,389 (10/3/11 - 39,277) unique visitors (of which 45,151 (10/3/11 - 13,929) are returning visitors) from 103 countries and 1,574 cities & towns in Europe (37; 764 cities), North America (3; 373 cities) , Central America & Caribeans (6; 13 cities), South America(10; 226 cities), Africa & Middle-East (12; 44 cities) , Asia-Pacific (21; 175 cities). So, obviously Clipper is Alive & Well : -)


TIA & Enjoy ! (10th October 2012, 11:05; 13th November 2015)


Original Welcome Page for Clipper... Clipper... Clipper

This is the original Welcome Page for Clipper... Clipper... Clipper, which I am republishing for historical and sentimental reasons. The only changes that I have made was to fix all the broken links. BTW, the counter from counter.digits.com is still working :-)

Welcome to Chee Chong Hwa's Malaysian WWW web site which is dedicated to Clipperheads throughout the world.

This site started out as a teeny-weeny section of Who the heck is Chee Chong Hwa ? and has graduated into a full blown web site of more than 140 pages (actually hundreds of A4 size pages) ! This is due to its growing popularity and tremendous encouragements from visiting Clipperheads from 100 countries worldwide, from North America, Central America, Caribbean, South America, Europe, Middle-East, Africa and Asia-Pacific. Thanx Clipperheads, you all made this happen !


What is Clipper ?

You may ask, what is this Clipper stuff ? Could Clipper be something to do with sailing as it is the name of a very fast sailing American ship in the 19th century ?

Well, Clipper or to be precise, CA-Clipper is the premier PC-Software development tool for DOS. It was first developed by Nantucket Corporation initially as a compiler for dBase3+ programs. Since then, CA-Clipper has evolved away from its x-base roots with the introduction of lexical scoping & pre-defined objects like TBrowse. As at today, the most stable version ofClipper is 5.2e while the latest version, 5.3a was introduced on 21 May 1996.

As at 11th November, 1996, an unofficial 5.3a fixes file was made available by Jo French. See the About CA-Clipper 5.3a section for more details. BTW, Jo French uploaded the revised 5.3a fixes file on 20th November, 1996.

Latest News

The latest news is that CA has finally released the long-awaited 5.3b patch on 21 May, 1997.

For 5.3b users, you must a take a look at Jo French's comments on unfixed bugs in 5.3b.

BTW, have you used Click ? If you're a serious Clipperprogrammer and need an excellent code formatter, Click is a natural choice. How to get it ? Simple, access Phil Barnett's site via my Cool Clipper Sites.

32-bits Clipper for Windows ?

Have you tried Xbase ++ ? Well, I have and compared to Delphi (my current Windows programming tool of choice), I'm still sticking to Delphi.

Anyway, you should visit the Alaska Home Page. Give it a chance and then draw your own conclusions !.

The Harbour Project

Is this the future of Xbase ? Take a look at at the Harbour Project

You are Visitor # ...

According to counter.digits.com, you are visitor since 3 June 1996.

If you like or dislike what you see on this website, please drop me a line by clicking the email button at the bottom of this page or better still, by filling out the form in my guest book. If you are not sure what to write,click here to take a look at what other Clipperheads have to say.