Faster Migration

Quick Start to Migration

Chapter I – Text to text conversion

Section 2 – Faster Migration

Well …

Forget about all those mysterious DOS / console / command modes, batch processing, etc.

If you have tongs, don’t burn your hand!

Yes we have; so let’s use it:

Step : 1

Begin with making / assigning  a folder for your works; FE : C:\MyWorks

Note : Working in a separate and clean folder is important.

Step : 2

Build a “Harbour Project”  file : say MyTest01.hbp; and put a line into it :

My1stProg.prg

Step : 3

Build a a program  file : say My1stProg.prg ; and write your very first program:

REQUEST HB_GT_WIN_DEFAULT
PROCEDURE Main
   SETMODE( 25, 80 )
   CLIENTE = SPACE( 15 )
   @ 10, 15 SAY "Customer : " GET CLIENTE
   READ
   @ 12, 0
   ? CLIENTE
   WAIT
RETURN

Step : 4

Open your .hbp file with HMG-IDE and press “Run” button.

VeryFirstHarbourProject

That’s all !

Any other problem / question ?

Happy HMG’ing 😀

 

 

 

 

 

 

 

 

Hello World – 2

In the our first example in first Quick Start page, we wrote the “Hello World” clause on the title bar. Now, let’s put it on the form.

Build a new project with “HelloWorld2” name, copy HelloWord.prg to HelloWorld2.prg and change it as below:

#include <hmg.ch>
PROCEDURE Main()
   DEFINE WINDOW frmHWLabel ;
      AT 0,0 ;
      WIDTH 400 ;
      HEIGHT 200 ;
      TITLE 'Hello World-2' ;
      MAIN 

      DEFINE LABEL lblHello
         ROW 75
         COL 125
         VALUE "Hello World !"
         FONTNAME "Lucida"
         FONTSIZE 16
      END LABEL

    END WINDOW 

    ACTIVATE WINDOW frmHWLabel

RETURN // Main()

DEFINE LABEL and END LABEL statements are for “Label” definition structure for the a window ( in this example Windows named as “frmHWLabel ” ). Label itself must have a name (“lblHello” in this example), and this name must be unique, such as a variable name. Beginning these names with a descriptive prefix ( “lbl” in the example) is a good programming practice.

Between DEFINE – END statements there are main properties of this label. Row, col numbers ( in pixels of course),value (for labels, value is a string constant to write in the your form/window) and font properties (NAME and SIZE)

Almost every GUI control definitions HMG have two syntax : With DEFINE and END structure and with @ command.Thus in the above example instead of DEFINE LABEL and END LABEL structure, you can use alternate @ syntax :

@ 75, 125 LABEL lblHello ;
          VALUE "Hello World !" ;
          FONT "Lucida" ; 
          SIZE 16

A last note for this example : place

CENTER WINDOW frmHWLabel

statement END WINDOW statement and notice that how much HMG is powerful.

HelloWordLabel