Recent

Author Topic: How to preserve letter case of unit file names  (Read 7747 times)

russdirks

  • New Member
  • *
  • Posts: 35
How to preserve letter case of unit file names
« on: October 21, 2016, 11:22:56 pm »
Running under Windows, I've noticed that the IDE forces all unit filenames to lower case.  I've tried going into Windows Explorer and renaming the files to the casing that I want, which matches the casing in code, but eventually (and I'm not sure what triggers it) the IDE will put it back to lower case.

Is there some way to stop that?
« Last Edit: October 21, 2016, 11:49:05 pm by russdirks »

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: How to preserve letter case of unit file names
« Reply #1 on: October 21, 2016, 11:54:41 pm »
Check the settings in Tools->Options->Environment->Naming

Bart

russdirks

  • New Member
  • *
  • Posts: 35
Re: How to preserve letter case of unit file names
« Reply #2 on: October 22, 2016, 12:05:26 am »
Thanks!

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: How to preserve letter case of unit file names
« Reply #3 on: November 22, 2016, 07:44:52 am »
Note the reason why the IDE does this:  on case sensitive filesystems (e.g. Linux), it also checks for the file in all lowercase. Keeping files lowercase saves a lot of headaches if the code is ever used on Linux. (otherwise the case in the USES clause must match exactly)

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: How to preserve letter case of unit file names
« Reply #4 on: November 22, 2016, 09:12:35 am »
Thanks!

You should have written thanks, but no thanks, because of what Marco explained. It is a bad idea.
Specialize a type, not a var.

russdirks

  • New Member
  • *
  • Posts: 35
Re: How to preserve letter case of unit file names
« Reply #5 on: November 22, 2016, 05:59:06 pm »
You should have written thanks, but no thanks, because of what Marco explained. It is a bad idea.

That is your opinion, one which I do not happen to share.  For me, having my unit files in mixed case is highly desirable, whereas making sure my uses clauses match the file name case is no trouble at all.  (You do know the IDE has a search & replace feature, don't you?).  So for me, it is a good idea

Akira1364

  • Hero Member
  • *****
  • Posts: 561
Re: How to preserve letter case of unit file names
« Reply #6 on: November 27, 2016, 12:50:00 am »
Just came across this thread, felt like giving my "two cents":
As far as the IDE auto-lowercase feature is concerned, I've never cared enough either way for it to bother me or not bother me. However, I would tend to agree with "russdirks" in that there are certainly many situations where a project (especially one that consists of a high number of units and multiple developers) might benefit from a mixed-case naming scheme.

Secondly:
As much respect as I have for the Linux project as a whole, I certainly feel that the fact that it can't handle mixed-case filenames in 2016 is sheer insanity that should not be viewed by anyone as "ok" or "just how Linux is". It's just a missing feature. Nothing more. Little things like that are the reason people who are still honestly waiting for the "year of the Linux desktop" are likely to be waiting for a very, very long time.
« Last Edit: November 27, 2016, 02:00:47 am by Akira1364 »

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: How to preserve letter case of unit file names
« Reply #7 on: July 04, 2017, 10:07:15 am »
  So for me, it is a good idea.
Well, if you don't care about cross platform, plz be my guest... I don't care...
Lazarus by default tries to be cross platform. Weird casing is not an option, only on Windows.
Specialize a type, not a var.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: How to preserve letter case of unit file names
« Reply #8 on: July 04, 2017, 11:20:31 am »
Well, now that we have successfuly found out that IDE gives us a choice, I really don't see a point for a further debate. No additional heated explanations will make anyone to change sides, and everyone is aware of benefits and shortcommings of both options.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018