Page 1 of 1
How I can to send a varieble to LABEL?
Posted: Sun Nov 11, 2012 2:35 pm
by Jairo Maia
There are a way for me to send a variable in LABEL? E.g.:
Code: Select all
Label_Definition := "Label_Name"
@ 10,10 LABEL Label_Definition ;
VALUE 'Name' ;
WIDTH 140 ;
HEIGHT 30 ;
FONT 'Arial' SIZE 09 ;
BACKCOLOR WHITE ;
FONTCOLOR BLUE BOLD
If I change file
i_label.ch that is way:
for this way:
it work. So, only if i send the label definition by varieble. Is possible to change for to use the both situations?
Re: How I can to send a varieble to LABEL?
Posted: Sun Nov 11, 2012 2:45 pm
by esgici
Ola Jairo
Jairo Maia wrote:There are a way for me to send a variable in LABEL? ...
I guess this will run:
Label_Definition := "Label_Name"
@ 10,10 LABEL
&Label_Definition ;
VALUE 'Name' ;
WIDTH 140 ;
HEIGHT 30 ;
FONT 'Arial' SIZE 09 ;
BACKCOLOR WHITE ;
FONTCOLOR BLUE BOLD
( Not tested

but remembering something like this )
Regards
Re: How I can to send a varieble to LABEL?
Posted: Sun Nov 11, 2012 2:55 pm
by Pablo César
Desculpem cavalheiros, não sei se já resolveu com a indicação que colega Esgici fez. Mas eu não entendi direito, Jairo: você quer mudar o nome da label ? Ou deixar variável o conteúdo do label ?
--
Excuse me gentlemen, I do not know now if was solved with the indication from our colleague Esgici. But I did not get it right, Jairo, you want to change the label name ? Or to leave variable the label content ?
Re: How I can to send a varieble to LABEL?
Posted: Sun Nov 11, 2012 3:15 pm
by Jairo Maia
Hello Esgici,
esgici wrote:I guess this will run:
Label_Definition := "Label_Name"
@ 10,10 LABEL &Label_Definition ;
I tried it, end I get the error:
Sintax Error
Olá Pablo,
Pablo César wrote:você quer mudar o nome da label ? Ou deixar variável o conteúdo do label ?
I want to pass the Label definition by variable.
How I said above, I want to know if there are a way for change the file
i_label.ch where I can pass the Label definition in both modes:
By Varieble:
Code: Select all
Label_Definition := "Label_Name"
@ 10,10 LABEL Label_Definition
By Default mode:
Best Regards
Re: How I can to send a varieble to LABEL?
Posted: Sun Nov 11, 2012 4:07 pm
by srvet_claudio
Jairo Maia wrote:Hello Esgici,
esgici wrote:
I guess this will run:
Label_Definition := "Label_Name"
@ 10,10 LABEL &Label_Definition ;
I tried it, end I get the error: Sintax Error
Hi Jairo.
Probably you defined the LABEL outside of the DEFINE WINDOWS adds PARENT Form_XX
Label_Definition := "Label_Name"
@ 10,10 LABEL &Label_Definition
PARENT Form_XX VALUE 'Name' WIDTH 140 HEIGHT 30 FONT 'Arial' SIZE 09 BACKCOLOR WHITE FONTCOLOR BLUE BOLD
Best regards,
Claudio.
Re: How I can to send a varieble to LABEL?
Posted: Sun Nov 11, 2012 6:39 pm
by esgici
Jairo Maia wrote:...I tried it, end I get the error: Sintax Error
Olá Jairo
I haven't any idea how you acquire this error
But this sample worked nice for me :
Code: Select all
#include <hmg.ch>
PROC Main()
Label_Definition := "Label_Name"
DEFINE WINDOW frmMILCName ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 200 ;
MAIN ;
TITLE "Using macro substitution in Label Control Name"
ON KEY ESCAPE ACTION frmMILCName.Release
@ 10, 10 LABEL &Label_Definition ;
VALUE 'Name' ;
WIDTH 140 ;
HEIGHT 30 ;
FONT "Arial" SIZE 09 ;
BACKCOLOR WHITE ;
FONTCOLOR BLUE BOLD ;
ACTION { || MsgBox( This.Name ) }
END WINDOW
frmMILCName.Center
frmMILCName.Activate
RETU // Main()

- Using macro substitution in Label Control Name
- UMILCNAM.PNG (10.58 KiB) Viewed 3334 times
In addition in
an old sample this macro substitution used for other controls too
( Caution : direct download link for .zip file )
Jairo Maia wrote:I want to pass the Label definition by variable.
Assumed you have intended "control name" with "Label definition". If you want mean another thing, please explain more precisely.
Regards
Re: How I can to send a varieble to LABEL?
Posted: Mon Nov 12, 2012 11:47 am
by Jairo Maia
esgici wrote:Olá Jairo
I haven't any idea how you acquire this error
But this sample worked nice for me :
Hello Esgici, you're right.
As you know, I am a beginner in HMG. So, in recent months I was studying and altering a series of tests in the SAMPLES folder and changing multiple files.
I do not know when and even where I changed something that detracted my work with HMG.
I did not can compile your example, so I decided to uninstall and reinstall my HMG.
Now everything is working properly.
Thanks to colleagues Pablo and Claudio for to have dedicated time to help me too.
Regards
Re: How I can to send a varieble to LABEL?
Posted: Mon Nov 12, 2012 1:17 pm
by esgici
Jairo Maia wrote:...Now everything is working properly.
Alright Jairo,
Happy HMG'ing
