Page 1 of 1
TOVAR and TagReference
Posted: Wed Dec 07, 2011 3:26 pm
by concentra
Hi.
I have a question about preprocessing DEFINE clauses.
Why TOVAR clause is needed to set a var that contains the object ?
Why not use <TagReference> as the var name to attribute the object ?
What is the target in doing it separately ?
Re: TOVAR and TagReference
Posted: Wed Dec 07, 2011 4:27 pm
by l3whmg
Hi Mauricio, how are you?
concentra wrote:Why TOVAR clause is needed to set a var that contains the object ?
Because only in some specific conditions (I'm referring XBase style and some new objects like layout and related handling ) you need a var to store the object (at program level) and then use it with some commands. With HMG3 XBase style you don't need it; always you use "formname:labelname:property". To preserve compatibility with previous program, IMHO this solution is better: WHEN you need var, you use TOVAR clause.
concentra wrote:Why not use <TagReference> as the var name to attribute the object ?
I'm sorry, but why do you need to use a "reference" as a var? I remember to you difference between OOP style and XBase style. On the other hand you have to be considered: internal HMG and external HMG. If you use <TagReference> as a var you must always declare this var (LOCAL or PUBLIC or PRIVATE): please take a look to HMG3 program. You never see this usage "tagreference.value"; you always see "form.tagreference.value" or "this.value" (but "this" is translated into "form.tagreference"). With OOP style you use other "syntax"; eg.
Code: Select all
CLASS myClass
DATA myform......
METHOD New
..........
As you can see, in this situation (natural with OOP style) you must create myform to have/handle the object.
"DEFINE WINDOW myform" is a semi-oop not a real OOP (but DEFINE WINDOW is translated into a real OOP code
).
Where is the problem?
Cheers
Re: TOVAR and TagReference
Posted: Wed Dec 07, 2011 6:12 pm
by concentra
Hi Luigi !
l3whmg wrote:Hi Mauricio, how are you?
Fine, only a little busy...
l3whmg wrote:Because only in some specific conditions (I'm referring XBase style and some new objects like layout and related handling ) you need a var to store the object (at program level) and then use it with some commands. With HMG3 XBase style you don't need it; always you use "formname:labelname:property". To preserve compatibility with previous program, IMHO this solution is better: WHEN you need var, you use TOVAR clause.
Ok.
I'm sorry, but why do you need to use a "reference" as a var? I remember to you difference between OOP style and XBase style. On the other hand you have to be considered: internal HMG and external HMG. If you use <TagReference> as a var you must always declare this var (LOCAL or PUBLIC or PRIVATE)...
Seems only that this is different than what I use to code...
Where is the problem?
I am coming back here after a while and updated my SVN tree and started to review all demos in order to see what changed and a lot of them are messaging warnings about unused vars. And it is related to this.
I will review the demos in order to complain coding in the way you explained and remove the warnings.
By the way, I also stated problems with missing
hmg_qtlocale.ch in
agoodstart demos.
Is this deprecated ? If so, may I delete this demos ?
[[]]
Re: TOVAR and TagReference
Posted: Wed Dec 07, 2011 6:40 pm
by l3whmg
Hi Mauricio
concentra wrote:hmg_qtlocale.ch Is this deprecated ?
It's unusefull because I sent to Pritpal all qt defined constants and he is included within HbQt include files. So this line is an error: must be changed with "#include hbqtcore.ch"
concentra wrote:If so, may I delete this demos ?
No! Why do you want delete them? Else, you can tune fine them: removing unused var and so on.... This is better isn'it?
Cheers
Re: TOVAR and TagReference
Posted: Fri Dec 09, 2011 10:43 am
by concentra
l3whmg wrote:It's unusefull because I sent to Pritpal all qt defined constants and he is included within HbQt include files. So this line is an error: must be changed with "#include hbqtcore.ch"
Ok, but I'm still getting an error for QLOCALE_ENGLISH and QLOCALE_GERMAN. The language not the country.
Re: TOVAR and TagReference
Posted: Fri Dec 09, 2011 11:58 am
by Ricci
concentra wrote:l3whmg wrote:It's unusefull because I sent to Pritpal all qt defined constants and he is included within HbQt include files. So this line is an error: must be changed with "#include hbqtcore.ch"
Ok, but I'm still getting an error for QLOCALE_ENGLISH and QLOCALE_GERMAN. The language not the country.
hmg_qtlocale.ch contains the country
and language codes.
hbqtcore.ch only contains the country codes!
You still have to use hmg_qtlocale.ch to call Localized( QLOCALE_GERMAN, QLocale_Germany )
Re: TOVAR and TagReference
Posted: Fri Dec 09, 2011 1:28 pm
by l3whmg
Hi Ricci and Mauricio.
You are right, Ricci, I don't see that hbqtcore doesn't contains language code. It's very strange because I sent all the codes. On the other hand, the hmg_qtlocale.ch was removed from hmg distribution.
Cheers
Re: TOVAR and TagReference
Posted: Fri Dec 09, 2011 3:48 pm
by concentra
Luigi, is it ok if I restore hmg_qtlocale.ch until the problem is solved ?
Re: TOVAR and TagReference
Posted: Sun Dec 11, 2011 6:38 pm
by l3whmg
Hi Mauricio,
I'm sorry I don't see this message. Anyway, I have done a commit and re-add hmg_qtlocale.ch with languages. You must use with hbqtcore.ch; see demo.
Cheers