help with syntax

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

help with syntax

Post by dragancesu »

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 213 times
huiyi_ch
Posts: 172
Joined: Sat May 21, 2016 5:27 am

Re: help with syntax

Post by huiyi_ch »

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: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: help with syntax

Post by serge_girard »

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
There's nothing you can do that can't be done...
User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: help with syntax

Post by dragancesu »

New version with source
Attachments
controls_source.zip
(30.05 KiB) Downloaded 174 times
controls_exe.zip
(1.48 MiB) Downloaded 183 times
Last edited by dragancesu on Wed Oct 02, 2019 11:19 am, edited 1 time in total.
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: help with syntax

Post by mustafa »

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: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: help with syntax

Post by dragancesu »

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: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: help with syntax

Post by mustafa »

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: 1060
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: help with syntax

Post by gfilatov »

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: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: help with syntax

Post by dragancesu »

Thank you

p.s. it may be time for retirement
User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: help with syntax

Post by dragancesu »

New version
Attachments
controls_exe.zip
(1.49 MiB) Downloaded 217 times
controls_source.zip
(44.93 KiB) Downloaded 196 times
Post Reply