END keyword not uppercase. lazarus / 11-Options ---------------------------------------------------------------------- segfault · 2019-04-01 12:42 This seems to be a bug, albeit a minor one. When selecting Tools/Options/Words/UPPERCASE the keywords are supposed to be uppercase when code is inserted, but "end" in procedures isn't. e.g. what you actually get is this : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PROCEDURE TForm1.Button1Click(Sender: TObject);BEGIN end;   I'm using Lazarus 2.0 on Win32. ---------------------------------------------------------------------- Thaddy · 2019-04-01 12:47 IT SHOULD BE ALL LOWERCASE. Uppercase was alright when Pascal got invented....We only had uppercase... Give the eyes some rest, please, and don't ask for dinosaurs to be raised from the grave. If there's an option for that, KILL IT.  To some extend I would allow propercase: your own declarations, classes, records, objects and members of those. ---------------------------------------------------------------------- segfault · 2019-04-01 13:30 QuoteIT SHOULD BE ALL LOWERCASE Is this the official line or the world as it should be according to Thaddy?  I guess it's a matter of preference. I know keywords are bold but I don't see how uppercase makes MORE work for the eyes. Didn't you just use capitals in your reply for emphasis? ---------------------------------------------------------------------- wildfire · 2019-04-01 15:39 Quote from: segfault on April 01, 2019, 03:30:09 pmIs this the official line or the world as it should be according to Thaddy?  It's generally accepted but as you know Pascal is case independent. If you're the only one reading your code then it's down to your preference. I'm with Thaddy though, it's easier on the eyes if keywords are lower case. ---------------------------------------------------------------------- Thaddy · 2019-04-01 16:31 It is a matter of preference. Feel free to use it - in private -.... I don't like the view and I don't like a finger occupied uselessly while typing. But indeed it is a matter of opinion, although most people use lowercase. (Although I acknowledge that if the option is offered, it's a bug...) ---------------------------------------------------------------------- Handoko · 2019-04-01 17:20 I vote for lower case too. Although I was a BASIC lover. (BASIC use uppercase) ---------------------------------------------------------------------- wp · 2019-04-01 17:23 Whatever the taste, it is a bug and should be reported in bug tracker. ---------------------------------------------------------------------- ASerge · 2019-04-01 17:25 Quote from: segfault on April 01, 2019, 03:30:09 pmIs this the official line or the world as it should be according to Thaddy?  http://wiki.freepascal.org/Coding_style: ...See the Lazarus coding guidelines: DesignGuidelines: ...Since one style is easier to read, Lazarus follows the CodeGear Coding Style Guide lines: ... 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. ---------------------------------------------------------------------- Thaddy · 2019-04-01 17:34 Yes, but it is still a bug when such an option is offered and the end part end up as end. instead of END... This is the case, as wp and I noted. ---------------------------------------------------------------------- 440bx · 2019-04-01 18:45 The whole lowercase and uppercase thing is a bit strange.  The majority of COBOL programs are all written in uppercase and, COBOL in lowercase looks strange.  I remember using a computer that used BASIC and if you typed something in lowercase, it would automatically uppercase it.   That pretty much settled the issue there... chuckle. Pascal code doesn't look right in uppercase.  Ultimately, except with case sensitive languages, it seems to be mostly subjective. ---------------------------------------------------------------------- BeniBela · 2019-04-01 20:28 I think we should all be more adventurous and use something more varied: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i pRoCeDuRe TFoRm1.BuTToN1cLiCk(SeNdEr: ToBjEcT);BeGiN EnD; ---------------------------------------------------------------------- Peter H · 2019-04-01 20:32 Look here: https://books.google.de/books/about/Algorithmen_und_Datenstrukturen.ht ml?id=kKMDBgAAQBAJ&printsec=frontcover&source=kp_read_button&redir_esc =y#v=onepage&q&f=false I personally, in the time of color pretty printing, prefer lowercase for keywords. BTW, at page 38, there is the proof, Niklaus Wirth used "äöü..." in variable names. Can FPC do this? ---------------------------------------------------------------------- Ñuño_Martínez · 2019-04-02 09:01 It is a personal taste thing, but I'm with mr. segfault here:  I find keywords uppercase and identifiers calmel-case (except constants) easier to read even with syntax highlighting.  May be because I'm used to it (I started with BASIC then QuickBASIC). ---------------------------------------------------------------------- ASerge · 2019-04-02 18:07 Of course, everyone likes its style, but when we publish code, uploaded on forum, need to adhere to common style. It's like social behavior: even if you're like to being naked at home, it's better not to do it on the street. Moreover, when I see such code in FPC sources: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Procedure getdir(drivenr:byte;Var dir:shortstring);I immediately get the feeling that the code was written by amateurs. But if it is in the form: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure GetDir(DriveNumber: Byte; var Dir: ShortString);this means that the author has published the code, knows how to work in a team and is probably more professional. ---------------------------------------------------------------------- munair · 2019-04-02 18:53 The days that BASIC used or converted keywords to uppercase also belongs to the dinosaurs. These days VisualBasic uses propercase aka titlecase by default. Personally I would vote for lowercase keywords and case dependency at the same time. ---------------------------------------------------------------------- VTwin · 2019-04-15 23:58 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). ---------------------------------------------------------------------- bylaardt · 2019-04-16 02:02 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   insignificantvarname  // for loops or other situations when i can reuse it.  ThisVarHasAContext    //  when i must explain  DO_NOT_DARE         // it's a screaming code  BDWTHISCANBESOCONFUSE // no comments  lower or upper? i don't care... i merely can do it! ---------------------------------------------------------------------- VTwin · 2019-04-16 02:12 Quote from: bylaardt on April 16, 2019, 04:02:12 amCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   insignificantvarname  // for loops or other situations when i can reuse it.  ThisVarHasAContext    //  when i must explain  DO_NOT_DARE         // it's a screaming code  BDWTHISCANBESOCONFUSE // no comments  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. ---------------------------------------------------------------------- bylaardt · 2019-04-17 15:16 Quote from: VTwin on April 16, 2019, 04:12:00 amIMHO, consistency, readability, and not yelling is helpful. At my age I try to write self-documenting code that can be passed along. +1 ---------------------------------------------------------------------- 440bx · 2019-04-17 15:27 Quote from: bylaardt on April 16, 2019, 04:02:12 amlower 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.) ---------------------------------------------------------------------- Thaddy · 2019-04-17 15:54 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.. (It's  not that strange: it is like how C++ was born) ---------------------------------------------------------------------- Bernd82 · 2020-12-11 09:27 Is this bug already repaired? I face the same problem. I personally like all keywords uppercase. ---------------------------------------------------------------------- marcov · 2020-12-11 10:24 Quote from: ASerge on April 01, 2019, 07:25:39 pmQuote from: segfault on April 01, 2019, 03:30:09 pmIs this the official line or the world as it should be according to Thaddy?  http://wiki.freepascal.org/Coding_style: That is writable for everybody, so it is hard to consider something like that "official". ---------------------------------------------------------------------- Bernd82 · 2020-12-11 10:58 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 · 2020-12-11 11:33 Tools > Options: Codetools > Words Keyword policy: Uppercase seems to work in 2.1 ---------------------------------------------------------------------- winni · 2020-12-11 12:23 Hi! As long as the fpc/Lazarus sources have no clear idea about upper/lower/mixed I don't care: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i MAXWORDbut Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i maxSmallint   I don't wanna hear some explanations like "historical reasons" or "C" or .... The whole discussions is nonsense. Winni ---------------------------------------------------------------------- Bernd82 · 2020-12-11 16:14 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 · 2020-12-11 16:37 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 · 2020-12-11 18:50 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PROCEDURE TForm1.Button1Click(Sender: TObject);BEGIN  |end; It doesn't happen if I type BEGIN and type key [Return]. In that case everything is correct: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i FOR i:=1 TO 10 DO BEGIN  |END; ---------------------------------------------------------------------- Martin_fr · 2020-12-11 19:27 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.