Page 2 of 4
Re: With a little help of the forum...
Posted: Sun Nov 20, 2011 10:01 am
by Ricci
esgici wrote:Apparently, we have begin a re-learn course for converting HMG3 applications to HMG4
f.e.
@ <nRow>, <nCol> syntax seems fully abandoned and our programs have tons of them
No no, these command are still working, it is only recommended to use the oneliners in the future.
@ 10,10 LABEL oLabel VALUE "abc" WIDTH 95 HEIGHT 20
is the same as
DEFINE LABEL oLabel; ROW 10; COL 10; VALUE "abc"; WIDTH 95; HEIGHT 20; END LABEL
if you take a look into the .ppo files.
Re: With a little help of the forum...
Posted: Sun Nov 20, 2011 10:09 am
by Ricci
esgici wrote:hmg4 is trying to set icon but its parameter is not the expected type.
In the example used only parameter is NIL. Does HMG4 don't understand NIL ?
Correct. (What is the sense of icon == NIL ?)
If you study the source codes of the controls you will find that HMG4 accept parameter without checking them the but Qt won´t. There wasn´t enough time to check every parameter of sense and validity.
We need more time ... there is a lot of work to do. Some controls has to be completely rewritten (i.e. printer class).
Re: With a little help of the forum...
Posted: Sun Nov 20, 2011 10:12 am
by esgici
Ricci wrote: these command are still working...
When attempted compile
Error E0030 Syntax error "syntax error at '@'"
occurs. This means "still working" ? My be "will work in the future", but for now it's not working, that's all !
@ 10,10 LABEL oLabel VALUE "abc" WIDTH 95 HEIGHT 20
is the same as
DEFINE LABEL oLabel; ROW 10; COL 10; VALUE "abc"; WIDTH 95; HEIGHT 20; END LABEL
When you have learned this? After taking a look to anywhere ?
--
Esgici
Re: With a little help of the forum...
Posted: Sun Nov 20, 2011 10:25 am
by Ricci
esgici wrote:When attempted compile
Error E0030 Syntax error "syntax error at '@'"
occurs. This means "still working" ? My be "will work in the future", but for now it's not working, that's all !
My code is full of these commands and my program is working well. So
it is working very well - I don´t know what you are doing without knowing your code.
esgici wrote:When you have learned this? After taking a look to anywhere ?
As usual: Study the samples and hmg.ch ! There you find all you need to know.
Re: With a little help of the forum...
Posted: Sun Nov 20, 2011 10:26 am
by esgici
Ricci wrote:(What is the sense of icon == NIL ?)
Please don't say me "look the .ppo file, look at the source code... etc". I know you are experts, you are system programmers and I'm only a end user. If you don't need opinions of users, please say clearly : "we are going the way we like, any opinion of anybody don't interest us".
If you don't know ( and probably don't understand ) sense and importance of
icon == NIL, how will be possible explaining by me ?
We need more time ... there is a lot of work to do.
Do you thing I don't know and I can't understand this ?
Re: With a little help of the forum...
Posted: Sun Nov 20, 2011 11:26 am
by Ricci
esgici wrote:If you don't know ( and probably don't understand ) sense and importance of icon == NIL, how will be possible explaining by me ?
Well, for the program "ICON := NIL" is the same like I say to you: "Here is a present for you: zero apples, bon appetit!"
One major thing every programmer should never forget: Every line of code is a potential source of errors.
That means: Keep you code as short as possible.
IF you need "ICON := NIL" for yourself, put it into /* .... */ or ...
... read the good HMG3 documentation. There you find at the DEFINE WINDOW page: .... [ ICON <cIconName> ]
<cIconName> means you must use a string as parameter, so ICON := "" will work.
Re: With a little help of the forum...
Posted: Sun Nov 20, 2011 11:43 am
by esgici
Did you heart a thing such as "default" or "defaulting"
Re: With a little help of the forum...
Posted: Sun Nov 20, 2011 11:56 am
by esgici
esgici wrote:
@ <nRow>, <nCol> syntax seems fully abandoned ...
Sorry, I'm very sorry this
Really,
@ ... syntax work properly in HMG4 too.
This was my faulty point
Regards
--
Esgici
Re: With a little help of the forum...
Posted: Sun Nov 20, 2011 11:59 am
by Ricci
esgici wrote:Did you heart a thing such as "default" or "defaulting"
Sure, but defaults are set in the background by the Qt- or HMG-objects itself, you don´t have to think about that. Only if you want to give them your own defaults, but NIL isn´t one, it´s invalid.
If you write nothing about ICON than the default is an empty string (= no icon), the same as ICON := "".
Re: With a little help of the forum...
Posted: Sun Nov 20, 2011 12:22 pm
by mrduck
Please calm down everybody.
Does anyone uses ICON = NIL to unset the icon ?
If not, change the code as below, adding the .AND. to the ELSEIF...
Code: Select all
METHOD Icon( cValue ) CLASS BASIC
IF PCOUNT() == 0
RETURN ::cIcon
ELSEIF PCOUNT() == 1 .AND. valtype( cValue ) == "C"
::cIcon := cValue
::oQTObject:setWindowIcon( ::cIcon )
ENDIF
RETURN NIL