Migration from Clipper to HMG

Moderator: Rathinagiri

User avatar
tonton2
Posts: 245
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Has thanked: 3 times
Been thanked: 6 times
Contact:

Migration from Clipper to HMG

Post by tonton2 » Thu Jul 11, 2013 4:33 pm

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: 4363
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 245 times
Been thanked: 91 times
Contact:

Post by esgici » Thu Jul 11, 2013 8:27 pm

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: 2050
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 89 times
Been thanked: 12 times
Contact:

Post by danielmaximiliano » Thu Jul 11, 2013 9:56 pm

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 2577 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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
tonton2
Posts: 245
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Has thanked: 3 times
Been thanked: 6 times
Contact:

Post by tonton2 » Fri Jul 12, 2013 9:15 am

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: 2050
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 89 times
Been thanked: 12 times
Contact:

Post by danielmaximiliano » Fri Jul 12, 2013 5:34 pm

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.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
tonton2
Posts: 245
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Has thanked: 3 times
Been thanked: 6 times
Contact:

Post by tonton2 » Sat Jul 13, 2013 1:14 pm

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: 4363
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 245 times
Been thanked: 91 times
Contact:

Post by esgici » Sat Jul 13, 2013 3:09 pm

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.
IDE_Unicode_ANSI.png
Defference between two IDE
IDE_Unicode_ANSI.png (20.03 KiB) Viewed 2450 times
Salam minel Turkiye
Viva INTERNATIONAL HMG :D

User avatar
tonton2
Posts: 245
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Has thanked: 3 times
Been thanked: 6 times
Contact:

Post by tonton2 » Sat Jul 13, 2013 4:13 pm

Alakoum essalem :P
shoukrane ya sadiki
L'Algerie vous salut
Y.TABET

User avatar
esgici
Posts: 4363
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 245 times
Been thanked: 91 times
Contact:

Post by esgici » Sat Jul 13, 2013 4:18 pm

tonton2 wrote:Alakoum essalem :P
shoukrane ya sadiki
Afven ya ahi
Viva INTERNATIONAL HMG :D

User avatar
tonton2
Posts: 245
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Has thanked: 3 times
Been thanked: 6 times
Contact:

Post by tonton2 » Sat Jul 13, 2013 5:18 pm

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
filtre1.JPG
in this kind
filtre1.JPG (27.61 KiB) Viewed 2438 times
L'Algerie vous salut
Y.TABET

Post Reply