Recent

Author Topic: END keyword not uppercase.  (Read 10974 times)

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: END keyword not uppercase.
« Reply #15 on: April 16, 2019, 01:58:53 am »
I programed in FORTRAN before it was Fortran. :)

Sounds like a bug, but I generally agree with Thaddy. I use lower case for key words, basic data types (byte, integer, string, double), and parameters (or, horrors, camelCase).
« Last Edit: April 16, 2019, 02:12:34 am by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

bylaardt

  • Sr. Member
  • ****
  • Posts: 309
Re: END keyword not uppercase.
« Reply #16 on: April 16, 2019, 04:02:12 am »
Code: Pascal  [Select][+][-]
  1.   insignificantvarname  // for loops or other situations when i can reuse it.
  2.   ThisVarHasAContext    //  when i must explain
  3.   DO_NOT_DARE           // it's a screaming code
  4.   BDWTHISCANBESOCONFUSE // no comments
  5.  

lower or upper? i don't care... i merely can do it!

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: END keyword not uppercase.
« Reply #17 on: April 16, 2019, 04:12:00 am »
Code: Pascal  [Select][+][-]
  1.   insignificantvarname  // for loops or other situations when i can reuse it.
  2.   ThisVarHasAContext    //  when i must explain
  3.   DO_NOT_DARE           // it's a screaming code
  4.   BDWTHISCANBESOCONFUSE // no comments
  5.  

lower or upper? i don't care... i merely can do it!

IMHO, consistency, readability, and not yelling is helpful. At my age I try to write self-documenting code that can be passed along.
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

bylaardt

  • Sr. Member
  • ****
  • Posts: 309
Re: END keyword not uppercase.
« Reply #18 on: April 17, 2019, 05:16:07 pm »
IMHO, consistency, readability, and not yelling is helpful. At my age I try to write self-documenting code that can be passed along.
+1

440bx

  • Hero Member
  • *****
  • Posts: 4014
Re: END keyword not uppercase.
« Reply #19 on: April 17, 2019, 05:27:22 pm »
lower or upper? i don't care... i merely can do it!
People can jump off the top of a high-rise without a parachute, it doesn't imply it's a good idea.  That said, TTBOMK, there have not been any casualties as a result of someone jumping off an uppercased letter (with or without a parachute.)




(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 14358
  • Sensorship about opinions does not belong here.
Re: END keyword not uppercase.
« Reply #20 on: April 17, 2019, 05:54:29 pm »
Well, I have this idea to have a poll to make C keywords mandatory uppercase in C21 (Plz vote YES, we don't care, cuz Pascal is case agnostic).
We can keep it under the radar of the C community and publish a draft RFC after the outcome, thus setting a precedent.. :D %) 8-) O:-)
(It's  not that strange: it is like how C++ was born)
« Last Edit: April 17, 2019, 05:59:59 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Bernd82

  • New Member
  • *
  • Posts: 30
Re: END keyword not uppercase.
« Reply #21 on: December 11, 2020, 10:27:07 am »
Is this bug already repaired? I face the same problem. I personally like all keywords uppercase.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11444
  • FPC developer.
Re: END keyword not uppercase.
« Reply #22 on: December 11, 2020, 11:24:40 am »
Is this the official line or the world as it should be according to Thaddy?  :D
http://wiki.freepascal.org/Coding_style:

That is writable for everybody, so it is hard to consider something like that "official".

Bernd82

  • New Member
  • *
  • Posts: 30
Re: END keyword not uppercase.
« Reply #23 on: December 11, 2020, 11:58:10 am »
Thanks for your effort. Unfortunately I do not understand your answer.

Is the problem solved or can I solve it myself?

P.S. The problem only happens when automatically generating a method for an event. The normal BEGIN ... END works.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9855
  • Debugger - SynEdit - and more
    • wiki
Re: END keyword not uppercase.
« Reply #24 on: December 11, 2020, 12:33:05 pm »
Tools > Options:
Codetools > Words

Keyword policy: Uppercase

seems to work in 2.1


winni

  • Hero Member
  • *****
  • Posts: 3197
Re: END keyword not uppercase.
« Reply #25 on: December 11, 2020, 01:23:06 pm »
Hi!

As long as the fpc/Lazarus sources have no clear idea about upper/lower/mixed
I don't care:

Code: Pascal  [Select][+][-]
  1. MAXWORD
but
Code: Pascal  [Select][+][-]
  1. maxSmallint  

I don't wanna hear some explanations like "historical reasons" or "C" or ....

The whole discussions is nonsense.

Winni

Bernd82

  • New Member
  • *
  • Posts: 30
Re: END keyword not uppercase.
« Reply #26 on: December 11, 2020, 05:14:43 pm »
Thank you Martin_fr, I will update from v2.0.8 to 2.1. Let's see if it works. Thanks again for the hint!

I already thought that this might be an almost religious theme  ;-)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9855
  • Debugger - SynEdit - and more
    • wiki
Re: END keyword not uppercase.
« Reply #27 on: December 11, 2020, 05:37:06 pm »
Just checked, the same setting/option exists in 2.0.x.

But I have not tested it there (I do not use it myself). I tested a single "end." (inserted when I hit enter) in 2.1 and that was uppercase.

That is for "end" auto-inserted, when you press return.


if you want to have any "end" that you type (by hitting the 3 keys e,n,d) to be converted, you may be able to do that with code-templates.


As for Jedi.... , I have no idea / not looked into it.

Bernd82

  • New Member
  • *
  • Posts: 30
Re: END keyword not uppercase.
« Reply #28 on: December 11, 2020, 07:50:41 pm »
I know, that the option uppercare exists and I have accordingly set it to uppercase for keywords.

The problem only occurs, if I generate let's say an OnClick method for a button by double clicking the button. Then the following code is generated with a lowercase end:

Code: Pascal  [Select][+][-]
  1. PROCEDURE TForm1.Button1Click(Sender: TObject);
  2. BEGIN
  3.   |
  4. end;

It doesn't happen if I type BEGIN and type key [Return]. In that case everything is correct:

Code: Pascal  [Select][+][-]
  1. FOR i:=1 TO 10 DO BEGIN
  2.   |
  3. END;

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9855
  • Debugger - SynEdit - and more
    • wiki
Re: END keyword not uppercase.
« Reply #29 on: December 11, 2020, 08:27:06 pm »
ok, that lower case "end", with all else correctly uppercase, that would be a bug.

Still wrong in 2.1

Check if there is a report on the bugtracker, and if not create one.

 

TinyPortal © 2005-2018