Recent

Author Topic: About file naming styles  (Read 607 times)

yinhuajian

  • New Member
  • *
  • Posts: 21
About file naming styles
« on: September 18, 2025, 03:33:11 am »
I created a form and named it uFrmMain.pas (in lowerCamelCase style), but the result I got was ufrmmain.pas (all lowercase). Is there any way to preserve the lowerCamelCase style?

ASBzone

  • Hero Member
  • *****
  • Posts: 733
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: About file naming styles
« Reply #1 on: September 18, 2025, 06:01:18 am »
What operating system?  What versions of FPC and Lazarus?

On Windows 10 & 11, it keeps the case that I use for my filenames.  (In fairness, it has kept it on all versions of Windows I have used Lazarus with, including Windows 7 and 8).
-ASB: https://www.BrainWaveCC.com/

Lazarus v4.3.0.0 (bcf314a670) / FreePascal v3.2.3-46-g77716a79dc (aka fixes)
(Windows 64-bit install w/Win32 and Linux on ARM and x64 cross-compilers via FpcUpDeluxe)

My Systems: Windows 10/11 Pro x64 (Current)

H₂SO₄

  • Sr. Member
  • ****
  • Posts: 485
Re: About file naming styles
« Reply #2 on: September 18, 2025, 06:42:34 am »
IDE Options (Shift + Ctrl + O)
Environment (first item)
Save As - auto rename Pascal files lower case (third box)
No automatic renaming

Bart

  • Hero Member
  • *****
  • Posts: 5756
    • Bart en Mariska's Webstek
Re: About file naming styles
« Reply #3 on: September 18, 2025, 10:37:27 am »
Using lower case filenames is recommended though (it makes the life of the compiler a bit easier when moving to a case-sensitve file system).

Bart

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12980
  • FPC developer.
Re: About file naming styles
« Reply #4 on: September 18, 2025, 11:39:51 am »
Using lower case filenames is recommended though (it makes the life of the compiler a bit easier when moving to a case-sensitve file system).

Yes, that is why the feature is there, at least originally. On a case sensitive file system, the casing in the USES clause must match, while all lower case file name is also checked (regardless of filename casing).

I'm not 100% sure this is still as necessary as it was before, since the compiler enumerates files now more (while in the past they were separate fileexists so STAT calls on unix). 

As for naming scheme, form/frame units end in -frm, while the form or frame in them has -Form or -Frame as identifier. This way unit name never clashes with form name.
« Last Edit: September 18, 2025, 02:03:03 pm by marcov »

 

TinyPortal © 2005-2018