Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Is there a way to trun off autoformating of "String" word?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 7 - Last Post: Sep 14, 2016 12:51 AM Last Post By: Rudy Velthuis (...
Dimitrij Kowalski

Posts: 92
Registered: 1/6/05
Is there a way to trun off autoformating of "String" word?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2016 5:59 AM
Hi guys.

My Delphi (XE5) tries to correct me every time when I write "String", it changes it automatically to "string". Is there a way to turn it off somehow?
I like to have type names starting from capital letter.

BTW: does anybody know why "string" is written in opposition to Integer, Boolean, Word, Float, Double, Real, Char, Byte <list can continue for a long time here...>

Best regards.
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: Is there a way to trun off autoformating of "String" word?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2016 6:06 AM   in response to: Dimitrij Kowalski in response to: Dimitrij Kowalski
Dimitrij Kowalski wrote:

Hi guys.

My Delphi (XE5) tries to correct me every time when I write "String",
it changes it automatically to "string".

That is because "string" (and "file") are reserved words, so they are
formatted as reserved words. You can change that formatting in the
formatting options.

But why do you want it to be "String"? "string" is correct, according
to the Object Pascal Style Guide
(http://edn.embarcadero.com/article/10280):

3.6 Reserved Words

Reserved words and directives should be all lowercase. This can be a
bit confusing at times. For instance types such as Integer are just
identifiers, and appear with a first cap. Strings, however, are
declared with the reserved word string, which should be all
lowercase.

--
Rudy Velthuis http://www.rvelthuis.de

Osborn's Law: Variables won't, constants aren't.

Edited by: Rudy Velthuis (TeamB) on Sep 13, 2016 3:07 PM

Edited by: Rudy Velthuis (TeamB) on Sep 13, 2016 3:08 PM
Dimitrij Kowalski

Posts: 92
Registered: 1/6/05
Re: Is there a way to trun off autoformating of "String" word?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2016 6:21 AM   in response to: Rudy Velthuis (... in response to: Rudy Velthuis (...
Rudy Velthuis (TeamB) wrote:
Dimitrij Kowalski wrote:

That is because "string" (and "file") are reserved words, so they are
formatted as reserved words. You can change that formatting in the
formatting options.

Thanks, than something else (GExperts, CNPack) must change it for me, becaus e I have this option set up to "As is".

But why do you want it to be "String"? "string" is correct, according

Haven't I answered this question already? According to my stye guide, "String" should start with capital letter as any other Delphi's native type. :)

It would be good to know why "string" is a reserved keyword and "Boolean" is not. I think whatever reason there was, it became obsolate like 15 years ago.

Best regards.
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: Is there a way to trun off autoformating of "String" word?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2016 6:29 AM   in response to: Dimitrij Kowalski in response to: Dimitrij Kowalski
Dimitrij Kowalski wrote:

Haven't I answered this question already? According to my stye guide,
"String" should start with capital letter as any other Delphi's
native type. :)

You could change your style guide. After all, it is a keyword, it is
highlighted as such and that should take precedence, IMO. <g>

--
Rudy Velthuis http://www.rvelthuis.de

"Dentist: a prestidigitator who, putting metal into your
mouth, pulls coin out of your pocket." -- Ambrose Bierce
Dimitrij Kowalski

Posts: 92
Registered: 1/6/05
Re: Is there a way to trun off autoformating of "String" word?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2016 6:35 AM   in response to: Rudy Velthuis (... in response to: Rudy Velthuis (...
Rudy Velthuis (TeamB) wrote:
Dimitrij Kowalski wrote:

You could change your style guide. After all, it is a keyword, it is
highlighted as such and that should take precedence, IMO. <g>

I could, if I would find a valid reason to do so. Currently there are two opposite conventions. It is just that for me, the String beeing a keyword does not make any sense. Either all native types should be reserved keywords or none.
Quentin Correll


Posts: 2,412
Registered: 12/1/99
Re: Is there a way to trun off autoformating of "String" word?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2016 10:59 AM   in response to: Dimitrij Kowalski in response to: Dimitrij Kowalski
Dimitrij,

| I could, if I would find a valid reason to do so.

Uhhh,... isn't you desire-complaint reason enough???

--

Q -- XanaNews 1.19.1.372 - 2016-09-13 10:58:56
Dimitrij Kowalski

Posts: 92
Registered: 1/6/05
Re: Is there a way to trun off autoformating of "String" word?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2016 11:26 AM   in response to: Quentin Correll in response to: Quentin Correll
Quentin Correll wrote:
Dimitrij,

| I could, if I would find a valid reason to do so.

Uhhh,... isn't you desire-complaint reason enough???

My desire is to have it my way :)
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: Is there a way to trun off autoformating of "String" word?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 14, 2016 12:51 AM   in response to: Dimitrij Kowalski in response to: Dimitrij Kowalski
Dimitrij Kowalski wrote:

Rudy Velthuis (TeamB) wrote:
Dimitrij Kowalski wrote:

You could change your style guide. After all, it is a keyword, it is
highlighted as such and that should take precedence, IMO. <g>

I could, if I would find a valid reason to do so. Currently there are
two opposite conventions. It is just that for me, the String beeing a
keyword does not make any sense.

In the past, there were several syntaxes for string, i.e. "string"
alone, or "string[15]", etc. That is why it is a keyword.

--
Rudy Velthuis http://www.rvelthuis.de

"I was playing poker the other night... with Tarot cards.
I got a full house and 4 people died." -- Steven Wright

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02