MsgInfoEx

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Re: MsgInfoEx

Post by Rathinagiri » Thu Oct 18, 2012 6:21 pm

Very nice image Claudio. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

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

Post by esgici » Fri Oct 19, 2012 8:23 pm

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

User avatar
srvet_claudio
Posts: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Sat Oct 20, 2012 1:18 pm

esgici wrote:Don't miss MyAlert() function of our friend Pablo Cesar.
Thanks brother Esgici, I will see.
Regards,
Claudio.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Wed Jun 11, 2014 6:19 am

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. ;)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Amarante
Posts: 182
Joined: Fri Apr 27, 2012 9:44 pm
Location: Araruama-RJ, Brazil

Post by Amarante » Wed Jun 11, 2014 1:56 pm

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

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Wed Jun 11, 2014 2:26 pm

IMHO, it is the difference between locate and seek.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
srvet_claudio
Posts: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Wed Jun 11, 2014 3:07 pm

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!
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Wed Jun 11, 2014 5:54 pm

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.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
srvet_claudio
Posts: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Wed Jun 11, 2014 6:54 pm

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.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

User avatar
Amarante
Posts: 182
Joined: Fri Apr 27, 2012 9:44 pm
Location: Araruama-RJ, Brazil

Post by Amarante » Wed Jun 11, 2014 9:02 pm

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.

Post Reply