Page 1 of 2

CamelCase

Posted: Sun Nov 10, 2013 12:03 am
by Pablo César
I have looking for this important (at least for me) all around Harbour, Minigui and also HMG but not found anything about this.

Probably will be usefull for many programmers and also important to implement in IDE which is having strange behaviour (click here for more details) about lower modules names.

This Demo brings the function CamelCase which have different options, here goes the convention and descriptions:
Goal: CamelCase converts strings.

Wikipedia: CamelCase (camel case) or medial capitals is the practice of writing compound words or phrases such that each word or abbreviation begins with a capital letter. Camel case may start with a capital or, especially in programming languages, with a lowercase letter. Common examples are PowerPoint or iPhone.

Syntax: CamelCase( cText, [String to be converted]
                            <lForce>, [Optional, Default: .T.]
                            <aRemChar> [Optional, Default: space and underscore] )

Author: Pablo César Arrascaeta

Version: 1.0

CamelCase "Convention" for this procedure:
a. Verifies if the string is completly in upper or lower case.
b. In case lForce be not omitted, with value .F. and item A
   been false, CamelCase will not convert it, remaining as is it.
c. Being pass lForce as .T. will convert it.
d. If array is passed in aRemChar parameter, will consider these
   elements to be removed.
e. Upper case will converted followed by characters like as:
   Space -> " "
   UnderScore -> "_"
   Dot -> "."
   Hyphen -> "-"
   Slash -> "/"
   BackSlash -> "\"

Reasons to use:
   - As opposed to allowing programmers to choose any character sequence
   - To reduce the effort needed to read and understand source code
   - To enhance source code appearance
     (for example, by disallowing overly long names or unclear abbreviations)
I hope you enjoy and be usefull. :)

Re: CamelCase

Posted: Sun Nov 10, 2013 4:21 am
by Rathinagiri
Very nice and different Pablo. Useful too. Thanks for sharing.

Re: CamelCase

Posted: Sun Nov 10, 2013 5:39 am
by bpd2000
Hi Pablo,
Useful tool
Thanks for sharing.

CamelCase

Posted: Sun Nov 10, 2013 1:28 pm
by Pablo César
Thank you both. Thanks to demostrate your interest. :)

Yes, usefull function also to convert full names... ;)

Rathinagiri, please feel you free to evaluate this example for including at HMG Samples for next releases or Claudio to include a new internal function at HMG IDE. :D

Re: CamelCase

Posted: Tue Nov 12, 2013 3:23 am
by esgici
Pablo César wrote:I have looking for this important (at least for me) all around Harbour, Minigui and also HMG but not found anything about this.

Probably will be usefull for many programmers and also important to implement in IDE which is having strange behaviour (click here for more details) about lower modules names.

This Demo brings the function CamelCase which have different options,...

I hope you enjoy and be usefull. :)
Thank to share :)

This is important and interesting subject to me also.

So I want to participate, hopefully no problem will occurs :arrow:

Everything is for community and we haven't any aim other than to search the better.
Screen sohot of Text Case Converter
Screen sohot of Text Case Converter
TextCaseConverter.JPG (62.85 KiB) Viewed 4804 times
TextCaseConvSrc.zip
Source files of Text Case Converter
(216.4 KiB) Downloaded 285 times
TextCaseConvExe.zip
Executable of Text Case Converter
(1.21 MiB) Downloaded 267 times
Please don't forgive my faults and shortcomings;

every kind of bug report, advice, suggestions, criticism etc. are welcome :arrow:

Happy HMG :D

Re: CamelCase

Posted: Tue Nov 12, 2013 4:39 am
by bpd2000
Nice
Thank you Esgici for sharing

Re: CamelCase

Posted: Tue Nov 12, 2013 9:11 am
by serge_girard
Thx for sharing!

Serge

Re: CamelCase

Posted: Tue Nov 12, 2013 10:42 am
by danielmaximiliano
Hola Pablo :
sin duda es una buena aplicacion, gracias por compartir.

Hola Esgici :
hay un dicho que dice " 2 manos en un plato hace un garabato " aqui es exactamente todo lo contrario.
gracias por el granito de conocimiento que deja dentro de HMGforum.

Translate Google

Hi Pablol:
it certainly is a good app, thanks for sharing.

Hello Esgici:
There is a saying "two hands in a dish makes a scribble" here is exactly the opposite.
thanks for the knowledge granite HMGforum left inside.

Re: CamelCase

Posted: Tue Nov 12, 2013 10:53 am
by Rathinagiri
That is very nice Esgici. Thanks for sharing.

Re: CamelCase

Posted: Tue Nov 12, 2013 11:42 am
by esgici
Hi Dave, Serge, Daniel and Rathi,

thanks to your interest and nice words :)
danielmaximiliano wrote: ..."two hands in a dish makes a scribble"...
This may be true for a PRIVATE dish ;)

There is another proverb :
two heads are better than one
Happy HMG :D