Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-08

Error when saving a new project: Unit.pas should not be used as file name

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jürgen Hestermann

When I create a fresh application, save it to an empty directory, then I am asked for two file names ("project1.lpi" and "Unit1.pas"). But the "Unit1.pas" name is not accepted and I get a warning saying (translated from german):

It looks like a Pascal file.
It is recomended to use non-capital letters for file names to avoid problems.
Rename it?

But the name was chosen by Lazarus itself!
Why did it use a file name that is not recommended and then ask the user whether it should be renamed?

Reply by email

Jürgen Hestermann
to Jürgen Hestermann
Show quoted text 5 lines
When I create a fresh application, save it to an empty directory, then I am asked for two file names ("project1.lpi" and "Unit1.pas"). But the "Unit1.pas" name is not accepted and I get a warning saying (translated from german):

Damned! Again this has been reported (this time 2 year ago):

http://bugs.freepascal.org/view.php?id=14122

The strange thing is, that I did not experience this behaviour with builts half a year ago and older.
I am wondering, why it only appeared recently (but it could also be, that I didn't use the default
names before).

Reply by email

Hans-Peter Diettrich
to Jürgen Hestermann: When I create a fresh application, save it to an empty directory, then I am asked for two…
Show quoted text 8 lines
When I create a fresh application, save it to an empty directory, then I am asked for two file names ("project1.lpi" and "Unit1.pas"). But the "Unit1.pas" name is not accepted and I get a warning saying (translated from german): It looks like a Pascal file. It is recomended to use non-capital letters for file names to avoid problems.

Dunno about the German wording, but IMO it's clear: You can save the file with an all-lowercase name, for compatibility with other platforms, or cased as it is (i.e. like the Unit name). Both versions are acceptable.

DoDi

Reply by email

Hans-Peter Diettrich
to Jürgen Hestermann: Damned! Again this has been reported (this time 2 year ago):…
Show quoted text 9 lines
J?rgen Hestermann schrieb: > When I create a fresh application, save it to an empty directory, then > I am asked for two file names ("project1.lpi" and "Unit1.pas"). > But the "Unit1.pas" name is not accepted and I get a warning saying > (translated from german): > Damned! Again this has been reported (this time 2 year ago): http://bugs.freepascal.org/view.php?id=14122
There exists an option for the Save action of camel cased units: Ask, Do
nothing, or Auto rename.
The strange thing is, that I did not experience this behaviour with builts half a year ago and older.

Maybe you changed the option to "Ask"?

DoDi

Reply by email