help with syntax

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
dragancesu
Posts: 696
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 23 times
Been thanked: 148 times

help with syntax

Post by dragancesu » Tue Sep 24, 2019 7:37 am

I use long hmg and some things still bother me, i don't like it
I prefer to use @ row, col CONTROL... instead of DEFINITON CONTROL...
that's why I don't use IDE, but many times I need help with syntax
I tried to create a program that will help me with the syntax for the controls, the parameters should be entered and you will see OK what you need to type in the text editor, but that text is in the clipboard so it is enough to press Ctrl-V or select Paste

The order of parameters at @ row, col CONTROL... and DEFINE CONTROL... is different, I don't know why but it bothers me

Pleasa write if you like it or don't like it and why

source soon
Attachments
controls.zip
(1.46 MiB) Downloaded 52 times

huiyi_ch
Posts: 106
Joined: Sat May 21, 2016 5:27 am
Has thanked: 2 times
Been thanked: 12 times

Post by huiyi_ch » Tue Sep 24, 2019 1:43 pm

I like DEFINE CONTROL...
This software is so useful that adding it as a tool, such as XEDIT, will greatly facilitate coding.

User avatar
serge_girard
Posts: 2342
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 588 times
Been thanked: 124 times
Contact:

Post by serge_girard » Wed Sep 25, 2019 6:51 am

Me too I sometimes have problems with these things.

When I need some comtrol I copy/paste it from one of my working programs and then I'm sure it work work fine for the first time.

Serge

User avatar
dragancesu
Posts: 696
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 23 times
Been thanked: 148 times

Post by dragancesu » Wed Oct 02, 2019 8:33 am

New version with source
Attachments
controls_source.zip
(30.05 KiB) Downloaded 22 times
controls_exe.zip
(1.48 MiB) Downloaded 20 times
Last edited by dragancesu on Wed Oct 02, 2019 11:19 am, edited 1 time in total.

User avatar
mustafa
Posts: 835
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 119 times
Contact:

Post by mustafa » Wed Oct 02, 2019 9:34 am

Google Translation

Hello friend Dragancesu :
Congratulations for this interesting Tool

I do not understand why the BUTTON is giving Error?
it is only for the chronological order of the mandates
I do not understand ?

I found it !!! ---> Syntax Error
Error --> HEIGTH --> ok ---> HEIGHT
Error ---> TOOLDTIP '' -> ok ---> TOOLTIP

Code: Select all


dragancesu

   @ 150, 100 BUTTON button_1 ;
      CAPTION 'caption_1'            ;
      PICTURE 'button.bmp' RIGHT ; 
      ACTION nil ;                         
      WIDTH 80 HEIGTH 25 ;   -------->  Error  -->   HEIGTH    --> ok  ---> HEIGHT
      FONT 'Arial' SIZE 10
             
     Error ---> TOOLDTIP ''     ok --->   TOOLTIP 

*-----------------------------------------------------------------*
Mustafa

       @ 150, 100 BUTTON button_1   ;
         CAPTION 'caption_1' ;
         PICTURE 'button.bmp' RIGHT ; 
         FONT "Arial" SIZE 10          ;
         ACTION nil   ;             
         WIDTH 80  HEIGHT 25 

Regards
Mustafa
Last edited by mustafa on Wed Oct 02, 2019 10:56 am, edited 1 time in total.

User avatar
dragancesu
Posts: 696
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 23 times
Been thanked: 148 times

Post by dragancesu » Wed Oct 02, 2019 10:54 am

Hello Mustafa, try this

start CONTROL.EXE, clik on button WINDOW than OK, window definition is on display

open in yout editor, on example, test.prg and Ctrl-V and see like this

Code: Select all

#include <hmg.ch> 

PROCEDURE main 

   DEFINE WINDOW window_1 ;
      AT 100, 100 ; 
      WIDTH 800 ; 
      HEIGHT 600 ; 
      MAIN ; 
 
      *** 
      *** 
      *** 
      *** insert your code here
      *** 
      *** 
      *** 

   END WINDOW 


   ACTIVATE WINDOW window_1 

RETURN 
create next control and insert code by ctrl-v

all work but generate control BUTTON causes error during compile

User avatar
mustafa
Posts: 835
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 119 times
Contact:

Post by mustafa » Wed Oct 02, 2019 11:06 am

It is not giving me any error
Did you modify the syntax error?

----> HEIGTH ----> OK HEIGHT

Code: Select all


#include <hmg.ch> 

PROCEDURE main 

   DEFINE WINDOW window_1 ;
      AT 100, 100 ; 
      WIDTH 800 ; 
      HEIGHT 600 ; 
      MAIN ; 
 
      *** 
      *** 
      *** 
   @ 100, 100 BUTTON button_1 ;
      CAPTION 'caption_1' ;
      PICTURE 'button.bmp' RIGHT ; 
      ACTION nil ;
      WIDTH 80 HEIGHT 25 ; 
      FONT 'Arial' SIZE 10 ; 

      *** 
      *** 
      *** 
      *** 

   END WINDOW 


   ACTIVATE WINDOW window_1 

RETURN 


Last edited by mustafa on Wed Oct 02, 2019 11:11 am, edited 1 time in total.

User avatar
gfilatov
Posts: 658
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 24 times
Been thanked: 227 times
Contact:

Post by gfilatov » Wed Oct 02, 2019 11:08 am

dragancesu wrote:
Wed Oct 02, 2019 10:54 am
generate control BUTTON causes error during compile
Hello Dragan,

Please be so kind to replace your typo
HEIGTH
with a correct
HEIGHT
as it was suggested by Mustafa :arrow:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
dragancesu
Posts: 696
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 23 times
Been thanked: 148 times

Post by dragancesu » Wed Oct 02, 2019 11:22 am

Thank you

p.s. it may be time for retirement

User avatar
dragancesu
Posts: 696
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 23 times
Been thanked: 148 times

Post by dragancesu » Mon Oct 07, 2019 11:42 am

New version
Attachments
controls_exe.zip
(1.49 MiB) Downloaded 41 times
controls_source.zip
(44.93 KiB) Downloaded 34 times

Post Reply