Showing posts with label Pritpal Bedi. Show all posts
Showing posts with label Pritpal Bedi. Show all posts

Wednesday, June 2, 2010

Harbour’s IDE - integrated development environment - centric, ready-to-use distibution.

CCH : Message by Pritpal bedi on my Guest Book

This is 99.9% configure free distro, just install,
copy one file from a folder and drop in another,
and use.

--------------------------------------------------

WELCOME

This is Harbour’s IDE - integrated development
environment - centric, ready-to-use distibution.

You can download it from
www.vouch.info/downloads/harbour_dev_setup.exe

This distro is comprised of following parts;

1. Harbour binaries for mingw and bcc.
harbour/bin/*
harbour/include/*
harbour/lib
bcc/*
mingw/*
harbour/doc/*
harbour/contrib/gtwvg/tests/*
harbour/contrib/hbqt/tests/*
/contrib/hbqt/doc/*
harbour/contrib/hbxbp/tests/*
harbour/tests/*
2. Mingw C compiler.
3. hbIDE.
4. Qt’s minimum runtime required to link
and execute a hbQT based application.
5. Environment

This distro also provides building-blocks to
experment with hbQT implementation. It is
particularly useful to Xbase++ developers
who are looking for alternatives.

Run the installer, and if possible, follow
the default folder - C;\harbour_dev. It is not
mandatory, just a suggession to keep the structure
simple enough to recognize. You can change the
drive as you wish, and even root folder, but
follow above advice if possible.

After installation is complete, you will have an
entry into the programs folder and also a desktop
icon if you did opted for it. Click any one or
at the end of installation opt for "Run..."

hbIDE’s welcome screen should popup in front of you.
To start anything significant, please follow few
simple steps, only once, to setup your environment.

1. Copy {app}env\hbide.env and paste it somewhere.
2. Open pasted copy and change

[ MINGW ]
{content} set IDE_INSTALL=C;\harbour_dev

to

[ MINGW ]
{content} set IDE_INSTALL=C;\somefolder\harbour_dev

assuming you have installed the setup in
C;\somefolder\harbour_dev instead of its default
location.

3. Run hbIDE.
4. Click "Compiler Environment" icon on the right
toolbar and provide the path_to_modified_hbide.env
in "Path to hbIDE env;" field.
5. The contents of this file must show-up.
6. Click "Save and Close" button.
7. That’s it. You are ready to build a project.

Let’s warm-up with an existing project before starting
some serious work.

1. From menu select "Open a Project".
2. File open dialog will showup. Navigate to
C;\harbour_dev\contrib\gtwvg\tests, and select
demowvg.hbp.
3. Project will appear in "Projects" tree window
at the left.
4. Right-click on the project name node - Demo WVG -
and from "Select an Environment" menu option
select "MINGW".
5. Again right-click on the project name node and
select "Build and Launch"
6. There you go, if everything is ok, project must
build and you must see demowvg.exe running.
7. Off course you will not see all the images
on the screen, because we have not instructed
this project to "Start in;" proper place, but
WVG console must appear.
8. Quickly add other projects - Demo WVG_XBP.
9. You can also play with demoXBP and demoQT but
for this to happen, you will need to provide
either _path_to_qt_dlls_ as global path which
should be visible to hbIDE or copy
{app}\harbour_dev\QtΜ.6.2\lib\*.dll to
Windows system32 folder or copy in the folder
where demoxbp.exe is residing.

A html compiled help file hbIDE.chm and the same
in PDF format hbIDE.pdf is also included in the
distro. Examine them. These are exactly the same
help which you can find online at
hbide.vouch.info /


hbIDE is now mature enough to handle any large
project, but still, please note that this is
not an official release, so you may expect bumps
here-and-there.

This distribution includes only binaries. Please
download SVN tree if you need sources or want to
play with the latest commits. It is not necessary
for your applications.


PROCESS ADOPTED BEFORE BUILDING THIS PACKAGE
- Updated Harbour Sources from SVN
- Build Harbour Binaries for above Compilers
- Compiled and Executed demowvg.prg
- Bundled the Package
- Uploaded to my site
- Downloaded the package on another computer
- Run the Installer
- Compiled and Executed demowvg.prg for each compiler


Enjoy

Pritpal Bedi

Friday, May 28, 2010

Free Vouch32 ActiveX Server

CCH : Contribution from Pritpal Bedi

Hello All

I have just uploaded Vouch32 ActiveX Server with
all the necessary files; application code with .hbp,
.chm help and the server without any restrictions.

It is compiled with latest Harbour and Przemek’s
excellent contribution towards this end. You do not
need to ask for license key. Use it. It has all the
powerful print engine with preview, graphic and charts
plus report generator, and is extremly easy to use.

The samples/harbour/V32xDemo.prg demonstrate
the application specific constructs and is accompanied
by .hbp. The server behaves best under GTWVG or GTWVT,
where it executes the dialogs in separate thread. But
console ( windows ) applications like GTWIN can also
use it.

Demo code also shows how to register server programatically.

More details and screen-shots can be found at
www.vouch32.com/

Regards
Pritpal Bedi

Monday, March 29, 2010

hbIDE is ready !

hbIDE, as the name implies, Harbour's Integrated Development Environment, is an open-source, multi-platform, project hosted inside Harbour's SVN repository. 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.

Currently, only Harbour as a compiler is supported, and hopefully soon, its domain will be extended to xHarbour, Xbase++, Clipper, Clip, Flagship.

The central essense of hbIDE is to provide a single-window interface to carry on all related actions for an application project to materialize, without needing any other tool in the process. This concept is extended to make use of n number of C compilers from within the same project definition.

For Harbour projects, hbIDE will take use of the its powerful make system, hbMK2. For other compilers, mechanism will be provided to define compiler, linker commands and source definitions. This will, usually, be a one time process, and for rest of the life of the project hbIDE will take over.

The topics enumerated at the left are just an indication what will go inside them. I will be updating them as time will permit, though my primary attention is the development of hbIDE.

To be just familiar with how the interface may look, a random screen shot of hbIDE, hosting my own production projects is presented below.


"plain" look:
onwelcomepage

"animated" look:
onwelcomepage_a


However, throughout these pages "Plain" look screen shots will be displayed.

More at  hbide.vouch.info

Tuesday, November 17, 2009

ROADMAP TO HBIDE - Prtipal Bedi -17 th Nov 2009

CCH : From the Harbour Main Developers List

2009/11/17 Pritpal Bedi <bedipritpal@hotmail.com>:

Hello All

Just a start for more discussions...

EMERGENCE OF THIS IDEA

Massimo: initiated idea to have "xMate" or "xMate like"   edit/compile/link/run cycle IDE but available for all   platforms  Harbour support.

Viktor: presented the minimum requirements an IDE must contain
  0) Availability on OS X, Linux and Windows x86 and x64.
  1) Very good editor with block editing capability, syntax
     highlighting, possibly "intellisense". Project-wide
     search and replace. Support for all CPs Harbour supports.
     ( syntax highlighting for: prg, c and cpp )
  2) Integration with VCS.
  3) Integrated build tool.
  4) Integrated project management.

Istvan: extended 3) above as  3.1) Integrated debugger.

Francesco: suggested to integrate "Eclipse" which he thought, and others supported, is a great tool, but also expressed that  he has no knowledge, so far, how it can be integrated with Harbour.

MY VIEWPOINT

Since the day Andy started development on xMate, I remained in  touch with this project and we had numerous talks about its features. since then xMate is an integral part of my development cycles. I am rather
a dire fan of xMate.

As this is a Windows only solution, it will probably be hard to port it to  any other platform, unless a great amount of time is not invested into it.

As of now I do not have requirements to convert my applications on all  platforms and as such xMate completely fulfils my needs.

Having said that, still, I am keen on developing an IDE, to a level  resembling  to xMate ( because of my intimacy as well a big user base ) in functionality  but extending it in other ways.

ROADMAP TO HBIDE:

0. Development style : PRG
1. Primary coding style : HBXBP
2. Extended calls ( if could not be included in HBXBP ) : HBQT
3. Base protocol for COMPILE/LINK cycle : HBMK2
4. 1st version : xMate like functionality
5. 2nd version : Integration of Qt CREATOR and .ui components
6. ...


BENEFITS ( apart from a multi-platform usage ):

1. Xbase++ class framework will be extended to include some very fine Qt extensions.
2. HBQT will be extented to include missing components which might be  necessary.
3. The resulting application will show up the strength of so many Harbour
4. The resulting application will offer a application framework for GUI development  to the beginners, i.e., it itself will be a demo application.

LOCATION

harbour/contrib/hbide

NAME

HBIDE - Harbour's Integrated Development Environment

CHANCES OF SUCCESS


Because project is purely based on PRG code, it is highly possible that  a lot of you may join this effort, not only for coding but also for debugging, suggestions  and whatever... So I see in optimism for its succeess.

DETERMINATION

I am geared up for its development no matter what will be the consequences, failure or success.
First commit will be around this weekend though I am in a position to show you up something.

NEXT REQUISIT

Your support in terms of vocalness.


Regards
Pritpal Bedi

Monday, September 21, 2009

[Harbour] HBNETIO - Production Application Usage

Date: Sun, 20 Sep 2009 22:22:08 -0700 (PDT)
From: Pritpal Bedi <bedipritpal@hotmail.com>
Subject: [Harbour] HBNETIO - Production Application Usage

Hello Everybody

Here is what I did to test my flagship application "Vouch"
under HBNETIO protocol concurrently with same system where
data resides, on LAN connected terminals with/without NETIO,
on real-time WEB-IP, and everything worked extremely fine.
The only issue worth reporting is the speed on WEB-IP
whic was 8 times slower than stand-alone and about
5 times slower than LAN.

ULTIMATELY - results were so satisfying that my clients
were noticeably impressed. And the credit goes to, PRZEMEK.
Thanks, you did a splendid job.

For WEB-IP we tested with this scenario:

1. Forwarded a port, #63000, on our wireless router.
2. Obtained a domain, vouch.dynalias.com, from DynDNS.com
3. Updated its IP with our server's IP.
4. Executed netiosrv.exe with  63000  192.168.1.108  c:\creative.v15
5. From the terminals invoked "Vouch.exe" with parameters
"vouch.dynalias.com" and "63000" through Vouch.ini.
6. Executed "Vouch.exe" as regular application as before from other
terminals and from same server station.

VOILA all went fine. One terminal employed was from out of the country.

All data updates, concurrent, were ok. All locks respected.

A big leap forward.

Regards
Pritpal Bedi

Tuesday, September 8, 2009

[Harbour] HBNETIO - A Case Study by Pritpal Bedi

CCH : From the Harbour Developers List

Date: Mon, 7 Sep 2009 13:29:16 -0700 (PDT)

Hello All

Here are the steps I took to convert my flagship application "Vouch" ( a mini ERP solutions for a variety of verticals ) to honor HBNETIO lib along-with normal execution as ususal.

BACKDROP

I use configuration file vouch.ini to set various parameters of the application, which beside setting extended protocols, sets the data paths too. So at any given point of execution every table/index/other file always contain fully qualified path.

This principal I adopted and implemented in my applications always made my efforts to switch to different RDD's which a minimum efforts and changes in the source code. Even mixing different RDDs for different parts of the application are made possible and been used successfully.

A table when used has this format:
  c:\creative.ram\checks.dbf  [ index: c:\creative.ram\checks.z01 ]
  ^^^^^^^^^^                                   ROOT FOLDER
                        ^^^^^^^                   TABLE
       =>
  net:checks.dbf

  c:\creative.ram\cac00001\vpn453za.dbf
  c:\creative.ram\caccomon\defaults.dbf   , etc
  ^^^^^^^^^^                                   ROOT FOLDER
                        ^^^^^^^                    AREA OF OPERATION
                                        ^^^^^^^    TABLE NAME
       =>
  net:caccomon\defaults.dbf

For HBNETIO protocol I just changed the root data path of any
supported file [ .dbf | .z01 (CDX) ] [ which must reside on the
data server ] with "net:" and that's it.

I executed the netiosrv.exe as:
  c:\creative.acp\netio\netiosrv.exe  63000  0.0.0.0  c:\creative.ram

And included in vouch.exe:

  #if 1   /* Net IO Client-Server Protocol */
     IF INIVLW( "NetIOEnabled" )
        cNetIOServer := IniValue( 'NetIOServer' )
        cNetIOPort   := IniValue( 'NetIOPort'   )
        IF !empty( cNetIOServer ) .and. !empty( cNetIOPort )
           lSuccess  := netio_connect( cNetIOServer, val( cNetIOPort ) )
           uiDebug( "netio_connect()", lSuccess, cNetIOServer, cNetIOPort )
           uiDebug( " " )
        ENDIF
     ENDIF
  #endif

IniValue() parses the vouch.ini and keeps in static variable and
supplies a value as requested.

The other functions which I adjusted to change the root
folder to "net:" looks like this:

Function VouExistTable( cAlias, cFile, cPath, cDriver, lTemp )
  Local lRet := .f.

  DEFAULT lTemp TO .f.

  cFile := UPPER( trim( cFile ) )
  if right( cFile,4 ) == '.DBF'
     cFile := substr( cFile, 1, len( cFile )-4 )
  endif

  do case

  case lTemp
     lRet := file( cPath +'\'+ cFile + '.DBF' )

  case cDriver == 'SQLRDD'
     lRet := VouIsFile( cFile )

  case cDriver == 'CACHERDD'
     #ifdef __CACHE__
     lRet := CacheExistTable( cFile )
     #endif

  otherwise
     IF Vou_IsNetIO()
        IF right( cPath, 1 ) == ":"
           cFile := cPath + cFile + '.DBF'
        ELSE
           cFile := cPath +'\'+ cFile + '.DBF'
        ENDIF
     ELSE
        cFile := cPath +'\'+ cFile + '.DBF'
     ENDIF
     lRet := DbExists( cFile )

  endcase

  Return lRet

//----------------------------------------------------------------------//

Function VouExistIndex( cAlias, cFile, cPath, cDriver, lTemp )
  Local lRet := .f.

  DEFAULT lTemp TO .f.

  cFile := UPPER( trim( cFile ) )
  if right( cFile,4 ) == '.Z01'
     cFile := substr( cFile, 1, len( cFile )-4 )
  endif

  do case

  case lTemp
     lRet := file( cPath +'\'+ cFile + '.Z01' )

  case cDriver == 'SQLRDD'
     lRet := VouIsFile( cFile,.t. )

  case cDriver == 'CACHERDD'
     #ifdef __CACHE__
     lRet := CacheExistIndex( cFile )
     #endif

  otherwise
     IF Vou_IsNetIO()
        IF right( cPath, 1 ) == ":"
           cFile := cPath + cFile + '.Z01'
        ELSE
           cFile := cPath +'\'+ cFile + '.Z01'
        ENDIF
     ELSE
        cFile := cPath +'\'+ cFile + '.Z01'
     ENDIF
     lRet := DbExists( cFile )

  endcase

  Return lRet

//----------------------------------------------------------------------//

FUNCTION Vou_IsNetIO()

  IF INIVLW( 'NetIOEnabled' )
     RETURN .t.
  ENDIF

  RETURN .f.

/*----------------------------------------------------------------------*/

FUNCTION Get_Path( cAlias )
  LOCAL cPath, p

  IF !empty( p := get_d_attr( cAlias,D_PATH ) )
     cPath := eval( COMPILE( p ) )
  ELSE
     cPath := setWPath()
  ENDIF

  IF get_d_attr( cAlias, D_FILE_TYPE ) <> 9  /* Vouch Specific and on the
Client */
     cPath := Vou_AdjustPathToNetIO( cPath )
  ENDIF

  RETURN cPath

/*----------------------------------------------------------------------*/

FUNCTION Vou_AdjustPathToNetIO( cPath )
  LOCAL n, cPathL

  IF Vou_IsNetIO()
     cPathL := lower( cPath )
     IF left( cPathL, 4 ) != "net:"
        n := at( 'creative.',  cPathL )
        IF n > 0  // And it must be
           cPath := "net:" + substr( cPath, n + 13 )
        ENDIF
     ENDIF
  ENDIF

  RETURN cPath

//----------------------------------------------------------------------//


NOTE: the above code is a case study only and should not
        be used as is. However you may adopt the similar approach if
        you want to.


OTHER CHANGES YOU MAY REQUIRE
==========================
  You may also need to swich to following changes which work in both modes.

  FILE()       =>   DBEXISTS()
  FERASE()   =>   DBDROP()

THE OBSERVATION
==============
  netiosrv.prg

//------------------------------//
proc main( cPort, cServer, cRoot )
  local pListenSocket

  if empty( cPort )
     cPort := '63000'
  endif

  pListenSocket := netio_mtserver( val( cPort ), cServer, cRoot )

  if empty( pListenSocket )
     ? "Cannot start server."
  else
     wait "Press any key to stop NETIO server."
     netio_serverstop( pListenSocket )
     pListenSocket := NIL
  endif

  return
//------------------------------//

  netiosrv.prg => hbmk2 netiosrv.hbp => netiosrv.exe

  * Consumes very little memory footprint : 2.5 MB
  * Consumes very little CPU time even if many instances are logged : 3-5%
  * With each instance increase in memory : 16 KB
  * Reduces 16 kb with every instance if quits or is killed
  * Record|File locks a released instantlt if an instance holding them is
killed.

THE EXPECTATIONS
===============
  Would been nice if root path be automatically stripped
  if "net:" is found a part of the table name, i.e.,
     net:c:\creative.ram\cac00001\mytable.dbf
        =>
     net:cac00001\mytable.dbf
         where
     c:\creative.ram == netiosrv's root path

THE RESULTS
==========
  Amazing.
  Przemek, accept my hats off to this contribution.

  BUT it will be really heartening if you decide to finish NETRDD.
  The community is looking at NETRDD desperately.

Regards
Pritpal Bedi

Friday, June 5, 2009

Breaking News : CacheRDD, a real-time RDBMS RDD for Harbour family of compilers

CCH : As posted in our Guest Book by Pritpal Bedi

Hello Everybody

Today is a special day in my life and I have
decided to share one of my best developments with all of you.

Let me introduce CacheRDD, a real-time RDBMS RDD for
Harbour family of compilers. This is the FIRST RDD in whole history
of xbase dialect that is a TRUE RDBMS RDD. Please visit
www.vouch.info/cacherdd for in depth review of its
accomplishments ( and shortcomings ).

The RDD ( binaries only ) will be available for
Harbour - MINGW, MSVC, BCC, PELLESC, WATCOM
xHarbour.org - BCC
xHarbour.com - XCC

Today I am just announcing. Within the next week or so
I will make available the complete distribution. The delay is
because today I am not prepared to assemble disto but I wished
that it be announced ( due to that special day ).

Regards
Pritpal Bedi

Tuesday, June 2, 2009

[Harbour] GTWVW => GTWVG Port - A Clarification by Pritpal Bedi


CCH: Quoted verbatim from a thread on the Harbour Developers List


Hi Budiyanto, All

> If you mean revising (or rewriting) GTWVW into Harbour, then I'll be very
> much interested, as well as
> many others. But please keep it backward compatible as much as possible. I
> remember you said here
> in the past that GTWVW is "impossible" to port to the new GT API because
> there is a conflict with
> GTWVW's use of first parameter as window designator (for most functions).
> Do you finally find a way
> to solve that problem? Or do you plan change the convention in GTWVW? (I
> hope it is the former.)
>
> Am I interpreting it right with what you mean by "porting GTWVW in GTWVG"?
>

When GTWVW came into existance I had already ported my applns to GTWVG,
the then GTWVT+WVTGUI, so I never looked into GTWVW deeply. Everything
I needed was available in GTWVG ( current name ). Rather at that time
I thought pseudo emulation of controls was good enough to appeal my clients
and I was saved of the time to learn a new protocol. With only little
efforts I was able to roll my applns with a new look and feel.

Over the time concepts changed. Multi-Window and Multi-Threading forced me
to look into real windows world. I was convinced that a lot can be achieved
on this front as MT and GT modal of Harbour is much superior to any other in the
market today.

I looked around for effective GUI modal to base my next developments
targetting not only my own needs but the Clipper community in general. The available
modals in-use for Harbour around were as follow:

1. FWH
2. VXH
3. HWGUI
4. MINIGUI
5. XAILER
6. GTWVW

Every modal had its pros and cons. Some had documentation missing,
some were pure IDE based, some dynamic but heavily based on #define(s)
( due a large number of parameters for a single activity ), and some lacked
OOP.
Every modal had its own parameters passing and calling convensions.
And, for sure, all modals lacked adaptation to MT, the biggest mainstay
in the coming future.

What I wanted to base next efforts on development of a GUI :

1) It must be adaptable to MT modal.
2) It should be able to take advantage of MW GT whereever possible.
3) It must adhere to standardization of parameters and calling convensions.
4) It must be having a well written documentation.
5) If possible, it must have a user-base.
6) And above all, it must be able to base Multi-Platform GUI.

After a lot of thinking and spadework I could not accept any of the above.
I just picked Xbase++. This compiler's subsystems were almost fitting
my ideology, is having a large user-base, ships with descent documentation,
complete with MT capabilities and nicely fits into Multi-GT environments.

Moreover I had worked with this compiler for some time and know how
best its parameters passing and calling conventions were. Also I wanted to
have a well define class framework to dream for a multi-platform GUI framework.

I knew to follow an already established framework is always a difficult
task.

To create a new protocol you are the master of your own thoughts. But to
copy feature-by-feature is very difficult. But I choose the difficult way.

Also I wanted to have an integrated library which could absorb different
scattered GUI modals into one as all were having one aspect in common -
Harbour.

My first results are quiet encouraging and now GTWVG can host:

* pure console,
* pseudo GUI console,
* Xbase++ consols and dialogs with xbase parts,
* pure consoles with Xbase parts,
* and a mixture of any of the above.

In this evolution process GTWVW becomes the next natural GEM to
be inducted in this whole picture, and probably FWH too, who knows.

If you invest a little time in GTWVG's Xbase++ implementation, you
will wonder how a Xbase++ .prg ( with only those controls which have
have taken some shape ) can be compiled in Harbour. And this is the
same intention for GTWVW too. No code change whatsoever.

As before, today also i say that it is difficult to port GTWVW as is
in new GT system. As GTWVG and GTWVW share the same code base at the
core levels it is easier to embed GTWVW GUI controls into GTWVG.
End user will not experience any change to his/her code. This way
it is not as difficult as it seems to be.

Also to rewrite it again will be sheer waste of time and resources.
In fact I could never take advantage of GTWVW because it become mutually
exclusive with GTWVG, and which I do not want at this time. Possibly
in the coming few days I will lay the base structure how GTWVW
functionality can be included in GTWVG. There onwards there should be
cummulative effort to achieve this goal. I alone can achieve but it may
take a bit longer.

To conclude, GTWVW is not going to be rewritten but will be included
in GTWVG and for sure end-user will need a minimum to change his code.


Hope I am clear enough.

Regards
Pritpal Bedi


Sunday, April 12, 2009

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


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

New Release of Harbour Ready to Use

CCH : A message posted by Pritpal Bedi on my Guest Book


Hello Everybody

Please download latest ready-to-use Harbour distro from
www.vouch.info/downloads/HarbourDev_10824_2009-04-09.exe

It fixes few mis-managements in _10523_ distro released in March.

Please note that Open Watcom binaries produces unresolved externals
with demowvg.prg. Rest all is fine.

I wanted to include QT implementation also but has deferred that
decision because still I am unable to find a way to compile demoqt.prg
through xMate PLUS a surprise that is swcheduled to be disclosed probably
next week...

Note; this distro includes PellesC compiler V 5.0 besides MINGW’s.
This has been made possible as Pelles Onius kindly consented to
include it in this distro.

Regards
Pritpal Bedi

PS; Note this is not an official release. It is an effort to ease out
migration to Harbour for newbies.

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 ...

Monday, March 16, 2009

GTWVG : Update by Pritpal Bedi

Hi Everybody

Here is the ChangeLog entry I committed today, may it interest you anyway;

2009-03-15 16;42 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* harbour/contrib/gtwvg/hbgtwvg.ch
+ #define HB_GTI_SETPOSANDSIZE
+ #define HB_GTI_HB_GTI_REFRESH
+ Two more events to manage new CUI-GUI objects.

+ #define GOBJ_OBJSTATE_*
+ #define GOBJ_OBJDATA_*
+ #define GOBJ_IMAGESOURCE_*
+ Constants to manage CUI=GUI objects.

* harbour/contrib/gtwvg/gtwvg.h
* harbour/contrib/gtwvg/wvggui.h
! Updated to be compilable for WinCE builds.

* harbour/contrib/gtwvg/gtwvg.c
! Updated to honor WinCE builds.
! Implemented double-buffering of console. Now flickering
should be the topic of the past.

* harbour/contrib/gtwvg/wvggui.c
! Updated to honor WinCE builds.

* harbour/contrib/gtwvg/wvgcuig.c
+ Implemented a highly optimized GUI controls for CUI consoles.
Implementation includes auto-destruction, data-substitution,
enable/disable feast, etc. These controls are almost identical
which are available with Wvt_Draw*() namespace but with a
great difference that these are tied to the urrent GT and
are handelled transparently by the GT itself. Developer
has only to define it. The only requirement is that
SaveScreen()/RestScreen() needs to be changed to new
Modal GT window. Appln screens will never get blurred. It
also employs optimized double-buffering and hence almost
eliminates screen flickering.

* harbour/contrib/gtwvg/wvgcore.c
* harbour/contrib/gtwvg/wvgsink.c
* harbour/contrib/gtwvg/wvgutils.c
* harbour/contrib/gtwvg/wvgwin.c
! Updated to honor WinCE builds.

* harbour/contrib/gtwvg/wvgcrt.prg
! A couple of methods fine-tuned.
! Modal GT’s more responsive to user needs.

* harbour/contrib/gtwvg/tests/demowvg.prg
! Demonstrated the latest implemention of CUI-GUI controls. See below.
Please try option in the main menu.
Also note the usage of Modal GT to simulate Alert() in new window.
Every GUI object returns a handle to it which may be used to
change its parameters.

; TOFIX( WINCE BUILDS ) - GetSystemDirectory()


/* IMPLEMENTATION OF CUI-GUI CONTROLS - A CODE PREVIEW



#xTranslate Alert( => MyAlert(

PROCEDURE GCUIConsole( oCrt )
LOCAL dDate ;= date()
LOCAL cName ;= pad( ’Some Usefule Name’ , 35 )
LOCAL cAdd1 ;= pad( ’Linda Goldman Avenue’, 35 )
LOCAL cAdd2 ;= pad( ’Excellent Street’ , 35 )
LOCAL cAdd3 ;= pad( ’Suit #415’ , 35 )
LOCAL nSlry ;= 9000
LOCAL nColGet ;= 8
LOCAL GetList ;= {}
LOCAL cLabel ;= "VOUCH, that GROWS with you"
LOCAL oTab, oStat, hBoxR, hTxt

SET SCOREBOARD OFF

SetColor( "N/W,N/GR*,,,N/W*" )
CLS
hb_gtInfo( HB_GTI_WINTITLE, "WVG Simplified yet Powerful CUI-GUI Console!" )

@ MaxRow(), 0 SAY PadC( "Navigate the Gets", maxcol()+1 ) COLOR "W+/B"

@ 2, nColGet SAY "<>"
@ 5, nColGet SAY "<" + PadC( "Name" , 33 ) + ">"
@ 8, nColGet SAY "<" + PadC( "Address", 33 ) + ">"
@ 15, nColGet SAY "<>"

@ 3, nColGet GET dDate ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 1 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,0,0 ) ), .t. }
@ 6, nColGet GET cName ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 2 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,255,0 ) ), ;
Wvg_SetGObjState( hBoxR, 3 ), .t. }
@ 9, nColGet GET cAdd1 ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 3 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,0,255 ) ), .t. }
@ 11, nColGet GET cAdd2 ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 4 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,255,255 ) ), ;
Wvg_SetGObjState( hBoxR, 1 ), .t. }
@ 13, nColGet GET cAdd3 ;
WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 198,21,140 ) ), .t. }
@ 16, nColGet GET nSlry PICTURE "@Z 9999999.99" ;
WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 0,0,0 ) ), .t. }

// The only additional calls to render your console GUI
//
// The GETLIST ; This can be embedded via @ GET preprocessor command
aEval( GetList, {|oGet| Wvg_BoxGet( oGet;Row, oGet;Col, Len( Transform( oGet;VarGet(), oGet;Picture ) ) ) } )
//
hBoxR ;= Wvg_BoxRaised( 1,2,18,49, {-5,-5,5,5} )
//
Wvg_BoxRecessed( 1,2,18,49 )
//
// Wvg_BoxGroup( 2,4,17,47 )
//
Wvg_BoxGroupRaised( 2,4,17,47, {-7,-7,7,7} )
//
hTxt ;= Wvg_TextBox( 3,57,16,75, {10,10,-10,-10}, ’This is first TextBox Line!’, 2, 2 )
//
Wvg_Image( 15,36,16,42, {-3,-3,3,3}, GOBJ_IMAGESOURCE_FILE, ’Vouch1.bmp’ )
//
Wvg_BoxRaised( 15,36,16,42,{-2,-2,2,2} )
//
Wvg_ShadedRect( 1,54,18,79, { -5,-5,5,5 }, 0, {65000,21000,7000,56000}, {255,32255,16000,32500} )
//
Wvg_BoxRaised( 1,54,18,79, {-5,-5,5,5} )

// Instruct GT to Repaint the Screen with GUI elements.
oCrt;refresh()

// Issue the read
READ

Alert( ’How did you like the "Alert" replacement?’, { ’WOW’,’OK’,’OOps’} )

RETURN
/*----------------------------------------------------------------------*/
#xUntranslate alert( =>

FUNCTION MyAlert( cMsg, aOpt )
LOCAL nSel, oCrt

oCrt ;= WvgCrt();New( , , { -1,-1 }, { 9, MaxCol()-6 }, , .t. )
oCrt;lModal ;= .t.
oCrt;icon ;= "dia_excl.ico"
oCrt;create()
oCrt;resizable ;= .t.

SetColor( ’N/W’ )
CLS
hb_gtInfo( HB_GTI_WINTITLE, cMsg )

nSel ;= Alert( cMsg, aOpt )

oCrt;destroy()

RETURN nSel

#xTranslate Alert( => MyAlert(
/*----------------------------------------------------------------------*/
STATIC FUNCTION FetchText( nMode )
LOCAL cText

DO CASE
CASE nMode == 1
cText ;= ’Do you know Harbour is gaining a popularity what Clipper enjoyed at one time! ’
cText += ’Enjoy it.’
CASE nMode == 2
cText ;= ’Do you know Harbour can host pure console, cui+gui console, pure gui consoles applications? ’
cText += ’This demonstration is a proof of that.’
CASE nMode == 3
cText ;= ’Do you know Harbour is a multi-gt, multi-window, multi-thread compiler far superior than others in the market! ’
cText += ’And is FREE.’
CASE nMode == 4
cText ;= ’Enjoy and contribute to the project any way you can. Develop, Debug, Support, and spread a word of mouth!’
ENDCASE

RETURN cText
/*----------------------------------------------------------------------*/
*/

;TODO - Write a comprehensive help to exploit CUI-GUI functionality.
Will do in a few days.


Here is the output;

Wednesday, March 4, 2009

Harbour Ready-to-use : Pritpal Bedi

WELCOME

http://www.vouch.info/downloads/HarbourDev_10523_2009-03-04.exe

This is Harbour's ready-to-use distibution planned to be released once in a month including the changes committed to SVN till the date of release. This is not the rule. I may post more than once in a month if there are major commits and/or some important feature is added/modified.

This distro is aimed at newbies who find it difficult to start with Harbour though everybody can take advantage to the maximum.

Please note that this is not an official release. So you may expect bumps here-and-there. My efforts will focus on the facts that release maintain a standard to let the applns compile properly.

Every release will bear the "Revision No" and "Date" in its setup name as -
HarbourDev_10523_2009-03-04.exe which will facilitate to identify upto which commit this release contain.

The tree structure ( outlined below ) can be used for production level development scenario. It contains batch files to get Harbour binaries
from SVN tree for four compilers. As you can now compile your applns with different compilers, this enhances your productivity level to judge which compiler is giving you the fastest and optimum appln.

To keep the tasks simple, I am assuming drive "C" the development drive where Harbour SVN tree and "harbour_dev" tree is hosted. All paths in the
batch files and xMate project files points to c:\harbour and C:\harbour_dev.

This distribution includes only binaries. Please download SVN tree if you need sources or want to play with the latest commits. It is not necessary
for your applications.

In case you decide to have latest SVN binaries then host it on drive C as module name "harbour". Then invoke one of the makegnu_*.bat, depending
on the compiler of your choice. It will place harbour binaries in respective subfolder of "c:\harbour_dev".

This distribution includes MINGW compiler under c:\harbour_dev\mingw folder as its root. So one is able to build appln for this compiler without any extra effort. You can download other compilers and place them in respective folders in c:\harbour_dev, i.e., Borland's BCC under c:\harbour_dev\bcc ( no suffix after bcc ), Sybase's Open Watcom under c:\harbour_dev\watcom, Microsoft's Visual C++ under c:\harbour_dev\msvc. Once installed, just invole respective makegnu_*.bat. Harbour binaries will be in place.

As I has been working with xMate since its birth way back in 2004, I have choosen it to be Project Builder for this distribution. You are free to deploy whatever you are accustomed to.

As a demo appln I have selected harbour/contrib/gtwvg/tests/demowvg.prg. This demo unfolds Harbour power in depth plus different ways one can employ to migrate his/her Clipper applications to GUI world strating with
intermediatery semi GUI proto and culminating to pure GUI proto. This demo also deploys the in-development Xbase++ Parts clone whaich may attract your attention. Moreoever, this demo demonstrates MT ( multi-threading ) and multi-window GT which can be a big productivity boost right from the begining.

Following is the tree structure this disto contains.

c:\harbour_dev\

harbour\
bcc\
bin
include
lib
msvc\
bin
include
lib
mingw\
bin
include
lib
watcom\
bin
include
lib

bcc\
* distro tree
msvc\
* tree
mingw\
* tree
watcom\
* tree

xmate\
*.files | folders
/
wvgBCC.env ( tied with demowvgBCC.xhp )
wvgMSVC.env ( tied with demowvgMSVC.xhp )
wvgMINGW.env ( tied with demowvgMINGW.xhp )
wvgWATCOM.env ( tied with demowvgWATCOM.xhp )

dev_projects\
demowvg\
demowvgBCC.xhp
demowvgMSVC.xhp
demowvgMINGW.xhp
demowvgWATCOM.xhp

demoxbp\
demoxbp.xhp
* folders
developers_own_folders\
developer_project.xhp

dev_sources\
demowvg\
*.files
tests\
*.files

dev_libs\
# All together - it is a better design

dev_exes\
# All together of by project
May be it is dependant on other resource files

ChangeLog ( Harbour SVN ChangeLog : Binaries Upto : Top Few Lines )

make.exe ( mingw32-make.exe )

bcc32.cfg ( Bcc Compiler Confuration : bcc\bin )
tlink32.cfg ( BCC Linker Configuration : bcc\bin )
wlink.lnk ( Watcom Linker Configuration : watcom\binnt )

[ invoke it to get latest Harbour SVN binaries ]
/
makegnu_BCC.bat
makegnu_MSVC.bat
makegnu_MINGW.bat
makegnu_WATCOM.bat

Enjoy

Pritpal Bedi, a student of software analysis and design

http://www.vouch.in | Vouch, the software that GROWS with you
http://www.vouch32.com | Home of Vouch32 ActiveX Server
http://www.vouchcac.com/vouch32/vouch32.htm | A Free Windows Extended
Utilities Library for Clipper, Xbase++ and (x)Harbour
http://www.help.vouch.info | Online Vouch Help
http://www.harbour.vouch.info | Online Harbour Help

Monday, March 2, 2009

what's the difference between GTWVT and GTWVG?

CCH: In an effort to 'guify' FAS4XHB.EXE, I wanted to retain the procedural approach (i.e no events-driven stuff)
I was advised by Ron Pinkas not to use gtwvw but to take a look at WVT & WVG

I found this interesting article by Clipper... Clipper...Contributor, Pritpal bedi of Harbour Project.

Response by Pritpal Bedi to a post dated 20th Nov 2007
entitled Gtwvt + Wvtgui = Gtwvg : xHarbour => Harbour

If used as pure console "NOTHING".

If used with GUI extensions, very appealing Windows screens without
sacrificing the Clipper syntax.

To have a bird's eyeview what we can achieve with GTWVG, visit:
http://www.vouchcac.com/ScreenShots/ScreenShots.htm
Though these screens are fairly old, the latest ones have toolbars etc too,
but even then you can have a fairly good overview. To just emphasize, this
lib does not change the way you write code, instead, provide mechanism to
enhance your code to give a GUI look.

This is one of my appln converted to GTWVG (Harbour) GTWVT+WVTGUI
(xHarbour).

Additionally GTWVG has a nice set of Wvt*Classes() which employ the common
event loop. You can create high performance dialogs with multiple Tbrowe,
Reads, Bitmaps, Buttons, i.e. all GUI elements you can think of.

More, you can open multiple pure Windows dialogs MODELESS or MODEL from
within your Clipper syntax.

I suggest you to experiment with xharbour/contrib/wvtgui/tests/wvtgui.prg to
learn more about these features. In future I will write a comprehensive
documentation.

If group agrees and someone more gifted developer join hands, these graphic
elements can be embedded with base GT to avoid additional code to be written
by the developer.

Based on GTWVG I am working on another libarry GTWVM ( Multiple Console
Terminal Driver ) just like in XBase++. There you can open multiple consoles
in an application containing its own GT and GUI elements and having its own
processing loop independant of others. It requires deep changes into GT core
code, which at the minimum needs a unique identifier for each GT command. I
have achieved a little bit but seems it is a long way to go, and perhaps, at
my own I cannot do everything. If group decided I can show a prototype of
what I am trying to achieve.

Hope you must be clear about the differences of GTWVT and GTWVG.

Regards
Pritpal Bedi, INDIA-USA

Tuesday, February 24, 2009

Multi-threading Issue: Response by Harbour's Przemek’s to Alaska's Steffen

Pritpal Bedi :
I think that whole MT issue can be discussed from two angles;

1) From TECHNICAL point of view.
2) From DEVELOPER (End-Users) point of view.

As I am not thoroughly equipped with technical part, I present hereunder Przemek’s ( one who implemented MT in Harbour ) response which he posted on Harbour’s Dev-List.

1. TECHNICAL PART

Xbase++ Steffen :
Sorry to use your blog to comment on the comments of others, as I think this is not the idea of a blog. Anyway please allow me to clarify my statement. I said "clean and easy to use way of multithreading", i didn’t say the Harbours don’t support Multithreading.

My statement is still true, even so Harbour and xHarbour have implemented the ability to execute code in multiple threads and have implemented some of the interfaces Xbase++ provides in one way or another. They are still far away from the idea and concepts of Xbase++ in that area.

In addition Harbour and xHarbour implemented different semantics of isolation. Which makes porting of complex MT applications for sure a mess. Let me clarify that.


Przemek:
It’s not true.

1-st Harbour and xHarbour use different MT implementation and they should not be confused.

In Harbour it’s possible to use threads like in xbase++. It support thread and signal classes/objects, the concept of zero zone for open workareas (dbRequest()/dbRelease()), SYNC object methods, isolated SET and RDD settings, coping or sharing memvars with parent threads. Also xbase++ thread related functions like ThreadID(), ThreadObject(), ThreadWait(), ThreadWaitAll() are supported.

It’s highly possible that I haven’t replicated xbase++ behavior exactly (f.e. the implementation of THREAD class should be extended yet to add support for thread restarting when thread interval is set but it’s rather simple .prg code and I hope that xbase++ users which are interested in exact emulation will make it. I’m not xbase++ user so I cannot easy test the details of implementation.

Harbour does not support thread priority but it’s not multiplatform and portable feature so it cannot be well implemented. Anyhow in few lines it can be added for those platforms which are supported by xbase++.

But in Harbour you can also use other things which does not exists in xbase++. The very important is also scalability which is far much better then in xbase++ or in xHarbour so if you have multi CPU machine you can expect that the speed of MT application will be noticeable improved.

The mutexes in Harbour give very flexible synchronization mechanism. They can be used as message queues, conditional variables or simple mutexes. PRIVATE and PUBLIC sharing or coping is optional and controlled by user. It’s possible to allocate many console windows in single thread or in many threads. Console windows can be shared between threads or can be dedicated to single thread only.

Harbour supports THREAD STATIC variables and they are used in core code. It means that Clipper’s code which need static variables like getlist implementation is MT safe in Harbour. It also gives very powerful mechanism for MT programmers. There are also many other things related to MT programming which seems to be unique to Harbour and does not exist in xbase++.

In summary Harbour offers xbase++ compatible MT API but rather as optional feature for programmers because it provides own more powerful and flexible one and the final applications are much better scalable.

Xbase++ Steffen
Multithreading as the ability to execute code in different code paths is a feature of modern OS sinces decades.

The problem with MT is that it adds another dimension of complexity to the developers task. While with single threaded apps. the developer needs only to think in a more or less sequential way with MT each execution path adds a new dimentions to the equation of programm complexity.

Development languages supporting MT such as Delphi, .NET (C#,VB) or Harbour and xHarbour support MT thats correct, but they do not remove the burden of correctness from the programmer. It is in the sole responsibility of the programmer to ensure programm correctness in two different areas; data-consistency and algorithm isolation.



Przemek:
I agree,


Xbase++ Steffen
The problem of data consistency occurs as soon as more than one thread is accessing the same data - such as a simple string or an array.

Besides nuances in terms of single or multiple readers/writers the consistency of the data must be ensured, so developers are forced to use mutex-semaphores or other higher level concepts such monitors, guards... to ensure data-consistency.



Przemek:
Yes, usually they are though different languages gives some additional protection mechanisms here so not always is necessary to use user level synchronization.


Xbase++ Steffen
Algorithm isolation is somewhat related to data-consistency, it becomes obvious that a linked-list accessed from multiple threads must be protected otherwise dangling pointer occurs. But what about a table/relation of a database.

The problem here is that concurrency inside the process can be resolved - but this type of "isolation" does break the semantics of the isolation principles which are already provided by the underlying dbms (sql-isolation-levels, record or file locks, transactions). Therefore algorithm isolation/correctness is a complete different beast as it is located at a very high semantic level of the task.


Przemek:
yes, it is.


Xbase++ Steffen
Alaska Software has put an enormous amount of research efforts into that area and we have more than a decade of practical experience with that area based on real world customers and real world applications.

From that point of view I would like to reiterate my initial statement "As of today there is still no tool available in the market which provides that clean and easy to use way of multithreading".


Przemek:
I was not making such "enormous amount of research efforts" ;-) Just simply looked at good balance between performance, basic protection and flexibility for programmers.


Xbase++ Steffen
Lets start with xHarbour, its MT implementation is not well thought, as it provides MT features to the programmer without any model, just the features. xHarbour even allows the usage of a workarea from different threads which is a violation of fundamental dbms isolation principles.

In fact xHarbour is just a system language in the sense of MT and makes life not really easier compared with other system languages. Therefore there is no value in besides being able to do MT. Also keep in mind due to the historical burden of the VM and RT core the MT feature is implemented in a way making it impossible to scale in future multi-core scenarios (see later-note).



Przemek:
I agree. Giving the unprotected access to workareas is asking for a troubles. It can create very serious problems (f.e. data corruption in tables) and gives nothing for programmers because they have to use own protection mechanisms to access the tables so final application have to be reduced to the same level as using dbRequest()/dbRelease() to lock/unlock the table. The difference is only that in such model programmer has to implement everything itself.

Xbase++ Steffen
Harbour is better here because if follows more the principles of Xbase++, while I am not sure if the Harbour people have decided to adapt the Xbase++ model for compatibility reasons or not I am glad to see that they followed our models point of view.

The issues with Harbour however is that it suffers from the shortcoming of its runtime in general, the VM design and of course the way how datatypes - the blood of a language - are handled. It is still in a 1980 architectual style centered around the original concept how Clipper did it.

This is also true for xHarbour, so both suffer from the fact that MT was added I think in 2007, while the VM and RT core is from 1999 - without having MT in mind.



Przemek:
Here I can agree only partially.

1-st Harbour does not follow xbase++ model. With the exception to xbase++ emulation level (xbase++ sync and thread classes, thread functions and sync methods) the whole code is the result of my own ideas.

The only one idea I partially borrowed is dbRequest()/dbRelase() semantic. Personally I wanted to introduce many workarea holders (not only single zero area zone) and dbDetach()/dbAttach() functions.

Later I heard about xbase++ implementation and I’ve found the cargo codeblock attaching as very nice feature so I implemented it but internally it operates on workarea sets from my original idea and still it’s possible to introduce support for multiple WA zones if we decide to add .prg level API for it. In some cases it maybe usable. Also the internal WA isolation in native RDDs is different. For POSIX systems it’s necessary to introduce file handle sharing and this mechanism is already used so now we can easy extended it adding support for pseudo exclusive mode (other threads will be able to access tables open in exclusive mode which is exclusive only for external programs) or add common to aliased WA caches. Of course Harbour supports also other xbase++ extensions but they were added rather for compatibility with xbase++ on xbase++ users and internally use basic Harbour MT API.

2-nd this old API from 1980 is a real problem in some places and probably will be good to change it. But I also do not find the xbase++ API as the only one final solution. Harbour gives full protection for read access to complex items. User have to protect only write access and only if he will want to change exactly the same item not complex item member, f.e. this code;

aVal[ threadID() ] += aVal[ threadID() ] * 2 + 100

is MT safe in Harbour even if the same aVal is used by many different threads.

Important is the fact that each thread operates on different aVal items and aVal is not resized. Otherwise it may cause data corruption. But when complex items can be resized the we usually need additional protection also in xbase++ because user code makes many operations which have to be atomic in some logical sense so in most of cases there is only one difference here between Harbour and xbase++; in xbase++ with full internal protection and missing user protection RT error is generated.

In Harbour it may cause internal data corruption. I agree here that it’s very important difference but in mouse of such cases we are talking about wrong user code which needs additional user protection in both languages. And here we have one fundamental question;

What is the cost of internal protection for scalability?

and if we can or cannot accept it. My personal feeling is that the cost will be high, even very high but I haven’t made any tests myself though some xbase++ users confirmed that it’s a problem in xbase++. I’m really interested in some scalability tests of xbase++ and Harbour. It could give few very important answers. If some xbase++ user can port tests/speedtst.prg to xbase++ then it will be very helpful.

Of course it’s possible that I missed something here but I’ve never used xbase++ and I cannot see its source code so I only guess how some things are implemented in this language.


Xbase++ Steffen
This is in fact one of the biggest differences between Xbase++ and the "Harbours" from a pure architectual point of view, we designed a runtime architecture from the beginning to be MT/MP and Distributed, they designed a runtime based on the DOS Clipper blueprint.

In fact, I could argue on and on, specifically it it comes to dedicated implementations of the Harbour runtime core or the Harbour VM but sharing these type of technical details is of course definitively not what I am paid for -;) Anyway allow me to make it clear in a general terms.


Przemek:

See above. It’s not such clear as you said.

I think that you will find users which can say that the cost of scalability is definitively not what they be paid for. Especially when the missing user protection is also problem for xbase++ and the bad results are only different.

For sure RT error is much better then internal data corruption but how much users can paid for such functionality.


Xbase++ Steffen
First, any feature/functionality of Xbase++ is reentrant there is not a single exception of this rule.

Second, any datatype and storage type is thread-safe regardless of its complexity so there is no way to crash an Xbase++ process using multithreading.

Third, the runtime guarantees that there is no possibility of a deadlock in terms of its internal state regardless what you are doing in different threads. There is a clean isolation and inheritance relationship of settings between different threads.

In practical terms that means, you can output to the console from different threads without any additional code, you can execute methods or access state of GUI (XbasePARTS) objects from different threads, you can create a codeblock which detaches a local variable and pass it to another thread, you are performing file I/O or executing a remote procedure call and in the meanwhile the async. garbagge collector cleans up your memory - and the list goes on...

But in Xbase++ you can do all that without the need to think about MT or ask a question such as "Is the ASort() function thread safe" or can I change the caption of a GUI control from another thread. Thats all a given, no restrictions apply, the runtime does it all automatically for you.


Przemek:

Most of the above is also true in Harbour with the exception to missing GUI components and obligatory internal item storage protection. But it’s the subject of efficiency discussed above.

Let’s make some scalability tests and we can decide if we want to pay the same cost of xbase++ users.


Xbase++ Steffen
Anyway, I like Harbour more than xHarbour in terms of MT support.

However the crux is still there, no real architecture around the product, leading to the fact that MT is supported form a technical point of view but not from a 4GL therefore leading to a potential of unnecessary burden for the average programmers, and of course that was and is still not the idea of Clipper as a tool.


Przemek:

The only one fundamental difference between Harbour and xbase++ in the above is obligatory internal items protection. At least visible for me now and as I said the cost of such functionality may not be acceptable for users. But let’s make some real tests to see how big problem it creates in real life.


Xbase++ Steffen
Btw, the same is true for VO or so, they left the idea of the language and moved to something more like a system -language, while I can understand that somewhat I strongly disagree with that type of language design for a simple reasons; its not practical in the long term - we will see that in the following years as more and more multi core system will find their way in the mainstream and developers need to make use of them for performance and scaleability reasons.

In 10 - 15 years from now we will have 100 if not thousands cores per die - handling multithreading , synchronisation issues by hand becomes then impossible, the same is true for offloading tasks for performance reasons.

So there is a need for a clean model in terms of the language - thats at least into what we believe at Alaska Software. It goes even further, the current attempty by MS in terms of multicore support with VS2010 or NET 4.0 are IMO absolutely wrong, as they force the developer to write code depending on the underlaying execution infrastructure alias cores available.

In other words, infrastructure related code/algorithms get mixed with the original algorithm the developers writes and of course the developer gets payed for. Thats a catastrophic path which for sure does not contribute to increased productivity and reliability of software solutions.


Przemek:

I agree with you only partially. Over some reasonable cost limit the MT programing stops to be usable and is much more efficient, safer and easier to use separated processes.

The cost of data exchanging between them will be simply smaller the cost of internal obligatory MT synchronization. So why to use MT mode? For marketing reasons?


Xbase++ Steffen
Funnily enough, the most critical, and most difficult aspect in that area; getting performance gains from multi core usage is even not touched with my technical arguments right now.

However it adds another dimension of complexity to the previous equation as it needs to take into account the memory hierarchy which must be handled by a 4GL runtime totally different as it is with the simple approach of Harbour/xHarbour. Their RT core and VM needs a more or less complete rewrite and redesign to go that path


Przemek:

I do not see bigger problems with Harbour core code modifications. If we decide that it’s worth then I’ll implement it.

Probably the real problem will be forcing different API to 3-rd party developers. Here we probably should chose something close to xbase++ C API to not introduce additional problems for 3-rd party developers which have to create code for both projects to have some basic ompatibility f.e. at C preprocessor level.

Anyhow I’m still not sure I want to pay for the cost of full item access serialization.


Xbase++ Steffen
In other words, Xbase++ is playing in the Multithreading ballpark since a decade.

Harbour is still finding its way into the MT ballpark while xHarbour is in that context at a dead-end.

I would bet that Xbase++ will play in the multicore ballpack while the Harbours are still with their MT stuff.


Przemek:

And it’s highly possible that it will happen. But Harbour is free project and if we decide that adding full item protection with the cost of speed is valuable feature then maybe we implement it.

It’s also possible that we add such functionality as alternative VM library. Just like now we have hbvm and hbvmmt we will have hbvmpmt (protected mt).


Xbase++ Steffen
In a more theoretical sense, it is important to understand that a programming language and its infrastructure shall not adapt any technical feature, requirement or hype. Because then the language and infrastucture are getting more and more complicated up to an point of lost control.

Also backward compatibility and therefore protection of existing investments becomes more and more a mess with Q&A costs going through the roof.


Przemek:

_FULLY_AGREE_. Things should be as simple as possible. Any hacks or workarounds for single features in longer terms create serious problems and blocks farther developing. For me it was the main of xHarbour problem when I was working on this project.


Xbase++ Steffen
Nor is it a good idea to provide software developers any freedom - the point here is, a good MT modell does smoothly guide the developer through the hurdels and most of the time is even not in the awareness of the developer.

The contrary is providing the developer all freedom, but this leads to letting him first build the gun-powder, then the gun to finally shoot a bullet -;)


Przemek:

;-)


Xbase++ Steffen
Therefore let me rephrase my initial statement to be more specific; As of today there is still no tool available in the market which provides that clean and easy to use way of multithreading, however there are other tools which support MT - but they support it just as an technical feature without a modell and thats simple wrong as it leads to additional dimensions in code complexity - finally ending in applications with lesser reliability and overall quality. Just my point of view on that subject - enough said

Przemek:

Thank you very much for this very interesting text. I hope that now the main internal difference between Harbour and xbase++ is well visible for users. To the above we should add yet tests/speedtst.prg results to compare scalability so we will know the real cost which is important part of the above description. I’m very interesting in real life results and I hope that some xbase++ users will port tests/speedtst.prg to xbase++ so we can compare the results.


Pritpal Bedi :
So, for those who were eager to understand underlying concepts of MT and how it is woven in these products, must be feeling at ease with above discussion. Believe me, me also found it very rewarding.

2. DEVELOPER (END-USER) PART
I will turn-up to it some other time.

Regards
Pritpal Bedi

Sunday, February 22, 2009

Harbour Does Support Multi-threading - Pritpal Bedi - 2009-02-22

CCH: on 22 February 2008, Pritpal Bedi, Harbour Developer posted an interesting entry in our Guest Book, which amongst other things clearly rebutted Xbase++ CTO, Steffen's assertion on 21 February 2009 that "As of today there is still no tool available in the market which provides that clean and easy to use way of multithreading"

He also documented his journey from CA-Clipper, CA-Visual Objects, Xbase++, xHarbour and finally to the Harbour Project.

Pritpal Bedi, 22nd February 2009

Hello Chee

Nice to see such an informative site to have upto-date information about trends and developments centering around language called "CLIPPER".

Developing mini-erp solutions for trade and indistry in general and for specific verticals, in Clipper, for over a decade, I recently have discontinued support for Clipper compilations for ever. Today all my applications are compiled with Harbour ( also with xHarbour for some specific purposes ) with a unique look and feel simulating Windows GUI.

In late 90s the demand for a visual uplift was more an more coming in,
Visual Object caught my attention and I tried my hands onto that. Alas! I failed miserably. Visual Obects was enforcing a new way of programming concept difficult to be accepted by one who has had invested a great amount of time and money on developing procedural code. More so, the procedural code was delivering what was expected. So I gave up after few months of frusration.

Then came
Xbase++, probably in 1998, and then I was filled with joy that this is exactly I wanted. Straight forward I subscribed to it, and continue to subscibe till date, though do not plan in the future. After few months I could convert my applications running on Xbase++. I was amused by the multi-threading modal and its capabilities to mix GUI and CUI elements on one screen. It paved the way for Clipper code to be migrated to Windows world. I was/is a dire fan of its XbpParts* class modal which implemented a standard way of objecthirarchy and parameters. I also put my applications in production sites but due to many technical difficulties I had to withdraw them and reinstalled Clipper compilations. I agree that those were the days when Xbase++ was evolving. I could hae concentrated on Xbase++ IF I could not came face-to-face with xHarbour...

My first attempts with
xHarbour were so rewarding that I could develop VOUCH32 library which could be used with Xbase++, xHarbour, Clipper ( not Harbour ). It proved to be very useful addon atleast for Clipper applns ( download statistics suggest that ). A journey started to port 16 bit code to 32 bits which was accomplished with little effort. But still everything was under debugging in the labs. An awesome contribution from Peter Rees ( GTWVT ) in Dec 2002 triggered my quest to provide Windows look and feel to my CUI applns. I could develop WVTGUI which gave my applns a new lease of life. I posted new technology to my clients by end 2003 which received a wide acclaim.

The journey continued. Though I could simulate Windows look and feel, but still I heavily missed multi-threading and multiple Windows support of Xbase++. Something I missed all those years.

In 2007 I turned to
Harbour. Ported all what I had contibuted to xHarbour and recompiled my applns. There I floated ideas of Multi-Threading and Multi-Windows which got momentum as I showed to the group its real benefits. Przemyslaw Czerpak, this great programmer, took to this challenge and introduced both concepts in a superb manner. I insisted on Xbase++ modal of Multi-threading minus its glitches which were taken care of in proper perspective. And the result is a robust MT modal which also implements Xbase++ functions and objects.

Recently I posted all my applications in production with Multi-theading and Multi-Windows, with a unique Windows look and feel and functionality, the source base being the same I used to compile with CLIPPER, just with addition ( not changes ) of few lines of code. CLIPPER is ALIVE as ever...

As Harbour and xHarbour are binary compitble projects, every development can be shared by both projects.

Somewhere on this blog I have read Steffens quote ;
"As of today there is still no tool available in the market which provides that clean and easy to use way of multithreading."

This is not true. Harbour is much more robust. But mind it, Xbase++ provided it in 1998 whereas Harbour implemented it in 2008, a generation-gap.

I must admit that at present Harbour ( in its core ) lacks a GUI component, a must for modern day requirements. To achieve this goal I have initiated development of WVG*Parts along the lines of Xbase++ Xbp*Parts, which by now, is shaping up well. It follows the Xbase++ class modal exactly it is documented. By now a simple Xbase++ application can be ported to Harbour with restricted GUI components, AS IS. Harbour may have a decent GUI in near future, who knows...

To sum-up I must say that the language "CLIPPER" we all loved most, we all earned our bread and butter for decaded, we all sweared-by, is
VERY MUCH ALIVE ...

Regards
Pritpal Bedi
a student of software analysis & design


Born 04 June 1956 at a small town Karnal, a part of the then Punjab province
of the Sovereign Republic of India, attracted to software development only in
1989 at the age of 33 years. Authored VOUCH, the software grows with you,
a mini ERP solution based on Indian way of business protocols. Attracted to
xHarbour in 2002 and soon contributed to the Clipper community, Vouch32.lib.

Also he contributed to the open-source project xHarbour whatever small
he could do, major contribution being WVTGUI, a library to give a look and
feel of Windows application to a character based console application. This
he could do on the top of GTWVT, a contribution by Peter Rees.

And now, he presents Vouch32 ActiveX Server raising the barrier of languages
and version control. A Com Object completely written in xHarbour and
compiled with xHarbour.com distribution.

Author is a Master degree holder in Commerce. Has served the banking industry,
has run a medium-scale retail business, and has achieved a little in
software development.

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.