Page 2 of 3

Re: MsgInfoEx

Posted: Thu Oct 18, 2012 6:21 pm
by Rathinagiri
Very nice image Claudio. :)

Re: MsgInfoEx

Posted: Fri Oct 19, 2012 8:23 pm
by esgici
Don't miss MyAlert() function of our friend Pablo Cesar.

It'is into STRU application.

Last version is here :

viewtopic.php?f=8&t=2443&start=140#p22142

Happy HMG'in :D

Re: MsgInfoEx

Posted: Sat Oct 20, 2012 1:18 pm
by srvet_claudio
esgici wrote:Don't miss MyAlert() function of our friend Pablo Cesar.
Thanks brother Esgici, I will see.
Regards,
Claudio.

Re: MsgInfoEx

Posted: Wed Jun 11, 2014 6:19 am
by Rathinagiri
Hi Claudio,

For your kind information, I have changed the order of parameters like this.

FUNCTION MsgInfoEx (xMsg, cTitle, cSeparator, bInfoDebug)

This way we can omit the extra , and it is very easy to find and replace all msginfo to msginfoex in my source code. ;)

Re: MsgInfoEx

Posted: Wed Jun 11, 2014 1:56 pm
by Amarante
translation via google:
I found this article here on the subject.
Frankly I could not see a significant difference and personally I like the "IF" structure in place of "CASE".
I think it is more a matter of taste since no significant change at runtime, but please me know if I'm wrong.
Regards,
Amarante

Re: MsgInfoEx

Posted: Wed Jun 11, 2014 2:26 pm
by Rathinagiri
IMHO, it is the difference between locate and seek.

Re: MsgInfoEx

Posted: Wed Jun 11, 2014 3:07 pm
by srvet_claudio
Rathinagiri wrote:Hi Claudio,

For your kind information, I have changed the order of parameters like this.

FUNCTION MsgInfoEx (xMsg, cTitle, cSeparator, bInfoDebug)

This way we can omit the extra , and it is very easy to find and replace all msginfo to msginfoex in my source code. ;)
Very nice!

MsgInfoEx

Posted: Wed Jun 11, 2014 5:54 pm
by Pablo César
Amarante wrote:Frankly I could not see a significant difference and personally I like the "IF" structure in place of "CASE".
I think it is more a matter of taste since no significant change at runtime, but please me know if I'm wrong.
Hi Amarante,

I also agree in parts with you. I have read this:
Is “elseif” faster than “switch() case” ?

Why do you care?

99.99% of the time, you shouldn't care.

These sorts of micro-optimizations are unlikely to affect the performance of your code.

Also, if you NEEDED to care, then you should be doing performance profiling on your code. In which case finding out the performance difference between a switch case and an if-else block would be trivial
I agree with just for the appearance which Do Case seems more clear IMHO, that is important. Micro-seconds of performance is not going to affect your system anyway. The important is the code to be more clear as posible for now and for the future interpretation, being by me or others.

Also I believe when many IFs are defined, many duplicated conditions could be attended at same time. So, IMHO Do Case I use when I just want only one choice.

This is my point-of-view. I hope to be helpfully to form a good own review.

Re: MsgInfoEx

Posted: Wed Jun 11, 2014 6:54 pm
by srvet_claudio
From the point of view of logic of programming ELSEIF is identically to DOCASE, because both are for mutually exclusive clauses.

This code is equivalent:

Code: Select all

CASE a == b   -->   IF a == b
CASE a == c   -->   ELSEIF a == c
CASE a == d   -->   ELSEIF a == d
OTHERWISE     -->   ELSE
If exist any difference in efficiency is due to the way the compiler implements these commands in Harbour, but not is due to the logic of evaluation.

Re: MsgInfoEx

Posted: Wed Jun 11, 2014 9:02 pm
by Amarante
Thanks for your answers. Of course I know that the "Case", depending on the compiler is faster than "if". But what I wanted to express is that in the example of the difference would be negligible Claudio and pleases me more, in most cases, the IF ... ELSEIF style to see the logic. But as I said ... it's just my humble opinion.