With a little help of the forum...

Moderator: Rathinagiri

Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: With a little help of the forum...

Post by Ricci » Sun Nov 20, 2011 10:01 am

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 :cry:
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.

Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Post by Ricci » Sun Nov 20, 2011 10:09 am

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).

User avatar
esgici
Posts: 4518
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 391 times
Been thanked: 111 times
Contact:

Post by esgici » Sun Nov 20, 2011 10:12 am

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
Viva INTERNATIONAL HMG :D

Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Post by Ricci » Sun Nov 20, 2011 10:25 am

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.

User avatar
esgici
Posts: 4518
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 391 times
Been thanked: 111 times
Contact:

Post by esgici » Sun Nov 20, 2011 10:26 am

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 ?
Viva INTERNATIONAL HMG :D

Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Post by Ricci » Sun Nov 20, 2011 11:26 am

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.

User avatar
esgici
Posts: 4518
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 391 times
Been thanked: 111 times
Contact:

Post by esgici » Sun Nov 20, 2011 11:43 am

Did you heart a thing such as "default" or "defaulting" :?:
Viva INTERNATIONAL HMG :D

User avatar
esgici
Posts: 4518
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 391 times
Been thanked: 111 times
Contact:

Post by esgici » Sun Nov 20, 2011 11:56 am

esgici wrote: @ <nRow>, <nCol> syntax seems fully abandoned ...
Sorry, I'm very sorry this :cry:

Really, @ ... syntax work properly in HMG4 too.

This was my faulty point :cry:

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Post by Ricci » Sun Nov 20, 2011 11:59 am

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 := "".

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Post by mrduck » Sun Nov 20, 2011 12:22 pm

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

Post Reply