Migration from Clipper to HMG

Moderator: Rathinagiri

User avatar
tonton2
Posts: 444
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Migration from Clipper to HMG

Post by tonton2 »

Bonsoir,
Je m'excuse mais mon anglais n'est pas parfait donc je fais une traduction en anglais

je suis débutant dans HMG,et je voudrais savoir comment ecrire ces lignes(clipper)dans HMG-IDE.
MERCI BEAUCOUP
Voila les differentes parties
Hello,
I'm sorry but my English is not perfect
I am a beginner in HMG and I want to know how to write these lines (clipper) in HMG-IDE.
THANK YOU VERY MUCH...
here are the different parts

****************************************************************
(1er) FIRST PART
****************************************************************

Code: Select all

     cls
     XMAJ=.F.
     SET COLOR TO
     cls
    SET COLOR TO W/r+
    @ 12,00 SAY "-----------------------"
    @ 13,00 SAY "                         "
    @ 14,00 SAY "-----------------------"

     @ 13,10 SAY "    Voulez-vous IMPRIMER les BON/LIVR D'un CLIENT  ? (Y/N) " get xmaj picture "Y"
     read
     if .not. xmaj
        * abondon
           set color to w/n
        cls
        return
     endif
*********************************************************************
(2) SECOND PART
*********************************************************************

Code: Select all

rechcli() // procedure 
    if exist=222
     return
    endif


seleCT 1
           USE bon_livr
   copy to tempvc for code=TTcode
      select 8
       use tempvc
*********************************************************************
(3rd) THIRD PARTY
*********************************************************************

Code: Select all

CLS
set date french
SET COLOR TO BG+/B
    
    @ 02,00 SAY " DONNER LA DATE DU DEBUT DU MOIS VOULU  :                                     "
    @ 03,00 SAY " DONNER LA DATE DE LA FIN DU MOIS DESIRE:                                     "
SET COLOR TO GR+/B,W+/R

   STORE CTOD('01/01/01') TO ldadeb
   read
      @  02,43 GET ldadeb picture "E"
   READ
      SET COLOR TO GR+/B,R+/W+
   STORE date() TO ldafin
      @  03,43 GET ldafin picture "E"
   READ
************************************************************
4 th part
************************************************************

Code: Select all

copy structure to gestemp
use gestemp

append from tempvc fields facture,date,reference for date >=ldadeb .and. date <=ldafin

               sum prix_total to ztot
               sum represent to zrepresent
               sum avance to zavaesp
               sum avancheq to zavacheq
               sum (avance+avancheq) to zavance
               sum tugp to zmontva
               ZDIFF=ztot-(Zavaesp+zavacheq+zrepresent)
*********************************************************************
5 th PART
*********************************************************************

Code: Select all

function rechcli

select 3
USE client INDEX clierech

 
 
SET COLOR TO GR+/B

acColonnes = {"CODE","NOM","ADRESSE"}
DBEDIT(0, 0, 22, 79, acColonnes,"Fdbutil")
        
         store code to TTcode
         STORE NOM to TTXnom
      

set color to R+/W+

     @ 13,22 SAY TTCode
     @ 13,32 SAY TTXNom
     @ 15,16 SAY "   Est ce le Client Souhait‚ ... ? (Y/N) " get xmaj picture 'Y'
    read
   
return""
THANK YOU
[u]Moderator Notes[/u] (Pablo César) wrote:Topic moved from other topic with subtitle "Welcome to the Project Developers' Table".
[u]Moderator Notes[/u] (Pablo César) wrote:Message re-edited to put the tag 

Code: Select all

 [/b]

Please note tag CODE is recommended when it is source code samples posted for better reading.[/color][/quote]
L'Algerie vous salut
Y.TABET
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Migration from Clipper to HMG

Post by esgici »

Salut Tonton !

Bienvenue à bord :)

First here a wrong place for your questions;

I hope forum management will move this topic to more convenient place; for example a new topic "Migration from text to GUI" under "HMG General Help" forum or anything else. Because here a forum of a discontinued HMG feature.

Second, please don't hesitate about language, Google Translate is very successful for translations between Romance languages.

Regarding your requests about migrating Clipper code to HMG :

1st Part :

Code: Select all

 cls
     XMAJ=.F.
     SET COLOR TO
     cls
    SET COLOR TO W/r+
    @ 12,00 SAY "-----------------------"
    @ 13,00 SAY "                         "
    @ 14,00 SAY "-----------------------"

     @ 13,10 SAY "    Voulez-vous IMPRIMER les BON/LIVR D'un CLIENT  ? (Y/N) " get xmaj picture "Y"
     read
     if .not. xmaj
        * abondon
           set color to w/n
        cls
        return
     endif
- There isn't any "global" color setting in HMG, every form ( window ) has own back-ground color and every control has own color setting. And fortunately you shouldn't specify every color unless you want make special color effects; all controls has own default color settings.

- You will continue using @ <nRow>, <nCol> ... syntax with some minor differences. Main difference is <nRow>, <nCol> numeric screen coordinate values refers pixels instead of bytes. We prefer @ <nRow>, <nCol> LABEL syntax as an equivalent of @ <nRow>, <nCol> SAY. Sadly, it isn't possible combining one SAY with one GET into one @ <nRow>, <nCol> command. We need a separate @ <nRow>, <nCol> with TEXTBOX clause for @ <nRow>, <nCol> GET. Another difference is we don't need READ command for TEXTBOXs as GETs.

- For getting user input we have more and more options than GET. Your example may be :

xMaj := MsgYesNo( "Voulez-vous IMPRIMER les BON/LIVR D'un CLIENT ?" )

For further options please refer to "Getting Logical" section of HMG Tutorial.

2nd Part :

Code: Select all

rechcli() // procedure 
    if exist=222
     return
    endif


seleCT 1
           USE bon_livr
   copy to tempvc for code=TTcode
      select 8
       use tempvc
In this part there isn't any UI process; so any difference between Clipper and HMG. You can use this part with no problem under HMG too.

3rd Party :

Code: Select all

CLS
set date french
SET COLOR TO BG+/B
    
    @ 02,00 SAY " DONNER LA DATE DU DEBUT DU MOIS VOULU  :                                     "
    @ 03,00 SAY " DONNER LA DATE DE LA FIN DU MOIS DESIRE:                                     "
SET COLOR TO GR+/B,W+/R

   STORE CTOD('01/01/01') TO ldadeb
   read
      @  02,43 GET ldadeb picture "E"
   READ
      SET COLOR TO GR+/B,R+/W+
   STORE date() TO ldafin
      @  03,43 GET ldafin picture "E"
   READ
STORE is a obsolet command; instead use assignment operators:

Code: Select all

   ldadeb = CTOD('01/01/01')
or 
   ldadeb := CTOD('01/01/01')
Please refer to 1st Part for other issues.

4th part :

Code: Select all

copy structure to gestemp
use gestemp

append from tempvc fields facture,date,reference for date >=ldadeb .and. date <=ldafin

               sum prix_total to ztot
               sum represent to zrepresent
               sum avance to zavaesp
               sum avancheq to zavacheq
               sum (avance+avancheq) to zavance
               sum tugp to zmontva
               ZDIFF=ztot-(Zavaesp+zavacheq+zrepresent)
In this part too, there isn't any UI process; so any difference between Clipper and HMG. You can use this part with no problem under HMG too.

5th Part :

Code: Select all

function rechcli

select 3
USE client INDEX clierech

SET COLOR TO GR+/B

acColonnes = {"CODE","NOM","ADRESSE"}

DBEDIT(0, 0, 22, 79, acColonnes,"Fdbutil")
        
         store code to TTcode
         STORE NOM to TTXnom

set color to R+/W+

     @ 13,22 SAY TTCode
     @ 13,32 SAY TTXNom
     @ 15,16 SAY "   Est ce le Client Souhait‚ ... ? (Y/N) " get xmaj picture 'Y'
    read
   
return"" 
No manipulation required on non-UI issues ( such as SELECT, USE ... ).

For SET COLOR ..., STORE, @ ... SAY/GET ... please refer above.

Instead of DBEDIT() you can use GRID or BROWSE controls; please refer to HMG DOC and look at HMG SAMPLES for details.

In summary, as you can see; there is n't any big difficulty to migrate from Clipper to HMG.

Only requirement is a bit patience, reading carefully HMG DOC and analyzing step by step, ( from simple to complex ) HMG samples.

Happy HMG'ing :D
Last edited by esgici on Thu Jul 11, 2013 10:51 pm, edited 1 time in total.
Viva INTERNATIONAL HMG :D
User avatar
danielmaximiliano
Posts: 2607
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Migration from Clipper to HMG

Post by danielmaximiliano »

Hola Tonton : Bienvenido a HMG, como el comentario que le hice anteriormente usted tiene que especificar si la migracion que necesita es hacia la consola (D.O.S) o hacia un entorno GUI (ventanas).

Translate Google (French)
Bienvenue à HMG, comme je l'ai fait plus tôt commenter vous devez indiquer si vous avez besoin est la migration vers la console (D.O.S) ou à une interface graphique (fenêtres).
main.png
main.png (19.52 KiB) Viewed 11317 times

Code: Select all

/**********************************************************************
(1er) FIRST PART
suggest using descriptive words to indicate type of variable.
"c" for Character cText
"n" to Numeric nNumber
"l" for Logico lLogic
"or" for Objects oObject
***********************************************************************/
#include "common.ch"
#include "inkey.ch"
#include "hmg.ch"


Function Main
 /* Console Mode */
 REQUEST HB_GT_WIN_DEFAULT
 SET EVENTMASK TO INKEY_ALL
 SetMode(25,80)
 lXmaj  := .F.
 SET COLOR TO
 cls
 SET COLOR TO W/r+
 @ 12,00 SAY "-----------------------"
 @ 13,00 SAY " "
 @ 14,00 SAY "-----------------------"
 @ 13,10 SAY " Voulez-vous IMPRIMER les BON/LIVR D'un CLIENT ? (Y/N) " get lXmaj picture "Y"
 read
 if .not. lXmaj
    * abondon
    set color to w/n
    cls
    return
 endif
  
Return
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
tonton2
Posts: 444
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: Migration from Clipper to HMG

Post by tonton2 »

Bonjour tt le monde,
Je vous remercie beaucoup .
Mon gros probleme est de migrer de clipper vers HMG en MODE (Console) GRAPHIQUE,c'est a dire essayer d'utiliser toutes mes requetes dans une interface graphique.
Merci encore une fois.
Hello
Thank you very much for your help.
My big problem is to migrate from clipper to HMG GRAPHIC MODE , that is to try to use all my requests in a graphical interface.
Thank you once again.
L'Algerie vous salut
Y.TABET
User avatar
danielmaximiliano
Posts: 2607
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Migration from Clipper to HMG

Post by danielmaximiliano »

Translate Google French
Bonjour Tonton2: pouvez-vous nous dire quel est votre nom?
Toutes les questions nécessaires pour compiler votre application via l'interface graphique sera répondu, mais si vous utilisez IDE qui est dans le dossier
c:\hmg.3.1.4\ide_ansi vera sur "Aide" manuel "référence HMG"
vous pouvez lire "de base" pour apprendre les bases de la création d'applications graphiques contenant des contrôles HMG.

pour une application en mode console vous avez déjà vu les agrégats inclus dans votre demande, mais l'environnement graphique, vous devez remplacer les instructions de base pour les contrôles clipper HMG.

vous rappeler que dans le mode console est exploité en utilisant ligne et colonne via l'interface graphique par des pixels à partir de 0,0

déterminer la taille de formulaire (fenêtre), vous devez tenir compte de ces contrôles.

Remplacer "?" pour la commande "label"
Remplacer "get" en commande "zone de texte"

peuvent également regarder les exemples qui sont inclus dans HMG qui sont situés dans C: \ hmg.3.1.4 \ samples et apprendre d'eux, si vous avez des questions suffit de créer un nouveau sujet ou dans quelques-uns des thèmes créés pour ce en effet, n'oubliez pas que vous devez exposer un petit exemple de ce que nous devons faire et ne savent pas comment la mettre en œuvre, rappelez-vous aussi que vous avez le forum de commande pour obtenir des informations car il peut être HMGforun un autre utilisateur a déjà posé la même question que vous besoin.

Translate Google

Hello Tonton2: can you tell us what is your name?
All questions required to compile your application via the GUI will be answered, but if you to used IDE that is in the folder
c:\hmg.3.1.4\ide_ansi on "Help" manual "reference HMG"
can you read "Basic" to learn the basics of creating graphics applications containing HMG controls.

for an application in console mode you already saw the aggregates included in your application but graphical environment you need to replace the basic instructions for the controls clipper HMG.

remind you that in console mode is operated using row and column via the GUI by pixels starting from 0.0

determine which form size (window) you need to accommodate these controls.

Replace "?" for control "label"
Replace "get" for control "textbox"

can also look at the examples that are included in HMG that are located in c: \ hmg.3.1.4 \ samples and learn from them, if you have any questions just create a new topic or within some of the topics created for this Indeed, remember that you need to expose a small example of what we need to do and do not know how to implement it, also remember that you have control forum to seek information as it can be HMGforun another user has already asked the same question that you need.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
tonton2
Posts: 444
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: Migration from Clipper to HMG

Post by tonton2 »

Hello,
please, can you tell me what difference is there between IDE and IDE-Ansi of the folder HMG 3.1.4. thank you
@+
L'Algerie vous salut
Y.TABET
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Migration from Clipper to HMG

Post by esgici »

tonton2 wrote:Hello,
please, can you tell me what difference is there between IDE and IDE-Ansi of the folder HMG 3.1.4. thank you
@+
Salam aleyk Tabet Youcef

IDE is Unicode supported and IDE-ANSI is Unicode not-supported.
Defference between two IDE
Defference between two IDE
IDE_Unicode_ANSI.png (20.03 KiB) Viewed 11190 times
Salam minel Turkiye
Viva INTERNATIONAL HMG :D
User avatar
tonton2
Posts: 444
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: Migration from Clipper to HMG

Post by tonton2 »

Alakoum essalem :P
shoukrane ya sadiki
L'Algerie vous salut
Y.TABET
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Migration from Clipper to HMG

Post by esgici »

tonton2 wrote:Alakoum essalem :P
shoukrane ya sadiki
Afven ya ahi
Viva INTERNATIONAL HMG :D
User avatar
tonton2
Posts: 444
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: Migration from Clipper to HMG

Post by tonton2 »

Bonsoir mon ami,
je voudrais savoir est ce possible d'avoir un exemple de filtre tel suggerer dans EDIT.EXTENDED (HMG\SAMPLES\EDITBOX\...) pour HMG ou HMG-IDE.
Merci beaucoup de votre AIDE
translat GOOGLE.
Hello my friend,
I want to know is it possible to have an example of such filter suggest in EDIT.EXTENDED (HMG \ SAMPLES \ EditBox \ ...) to HMG or HMG-IDE.
Thank you very much for your HELP
Attachments
in this kind
in this kind
filtre1.JPG (27.61 KiB) Viewed 11178 times
L'Algerie vous salut
Y.TABET
Post Reply