Recent

Author Topic: Is there a difference in the file extension .pp and .pas?  (Read 11332 times)

markus_ja

  • New Member
  • *
  • Posts: 43
Is there a difference in the file extension .pp and .pas?
« on: August 25, 2016, 10:54:27 am »
In the lazarus project there are a lot of .pp files.
Is there a difference to .pas files? Do I need to distinguish between these two file extensions?
What is the prefered way?

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Is there a difference in the file extension .pp and .pas?
« Reply #1 on: August 25, 2016, 11:02:45 am »
No, they are identical. The FPC team prefers to use the .pp extension. Initially it was to differentiate itself from Borland's TurboPascal and Delphi (*.pas) files - but that was a historic idea. In summary, the .pp and .pas files are exactly the same thing.
« Last Edit: August 25, 2016, 11:12:06 am by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

markus_ja

  • New Member
  • *
  • Posts: 43
Re: Is there a difference in the file extension .pp and .pas?
« Reply #2 on: August 25, 2016, 11:07:32 am »
Thanks!

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Is there a difference in the file extension .pp and .pas?
« Reply #3 on: August 25, 2016, 11:15:49 am »
No, they are identical. The FPC team prefers to use the .pp extension. Initially it was to differentiate itself from Borland's TurboPascal and Delphi (*.pas) files - but that was a historic idea. In summary, the .pp and .pas files are exactly the same thing.

But only to Freepascal and Lazarus.
In Delphi pp files will not be recognized as a pascal sourcefile.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Is there a difference in the file extension .pp and .pas?
« Reply #4 on: August 26, 2016, 11:43:37 am »
Well, this is the Lazarus and Free Pascal forums, so I assumed that is what is being used. ;-)
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: Is there a difference in the file extension .pp and .pas?
« Reply #5 on: August 26, 2016, 06:05:18 pm »
In the lazarus project there are a lot of .pp files.
Is there a difference to .pas files?

Only that a .pp will be found before a .pas. But mixing units that differ only in extension is not recommended.

Graeme's statement is correct, it was originally meant to set apart FPC specific code from Turbo Pascal code, but since it was only
a convention and not enforced (e.g. by automatic dialect switched), it became mixed quite quickly (in 1.0.x times).

I tried to keep .pas file associations with Delphi and .pp and with FPC, but too much is shared to make that worth the trouble.

So nowadays it doesn't mean much anymore.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Is there a difference in the file extension .pp and .pas?
« Reply #6 on: August 26, 2016, 07:39:51 pm »
I used to separate Delphi compatible units (.pas) and Free Pascal specific units (.pp). But it seems in the end I never really care about Delphi compatibility (I don't have and never touches Delphi), so I ended up making everything .pas.

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Is there a difference in the file extension .pp and .pas?
« Reply #7 on: August 28, 2016, 01:08:44 am »
I tried to keep .pas file associations with Delphi and .pp and with FPC, but too much is shared to make that worth the trouble.
I tried that too, many years back.... Problem was, then and still today... NO other text editors that support syntax highlighting knows about the .pp extension, so viewing such code always ends up being black and white text only. I now only use .pas extensions. Simple examples: gEdit, Pluma, jEdit, EditPad Pro, Kate, KWrite, mcedit, vim etc... just to name a few.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

DanishMale

  • Jr. Member
  • **
  • Posts: 73
Re: Is there a difference in the file extension .pp and .pas?
« Reply #8 on: August 30, 2016, 03:58:57 am »
Just a hint Notepad++ DOES color both .pp and .pas files   :-X

https://notepad-plus-plus.org/
Lazarus 2.2.4 x64 | Windows 10 x64 | Windows Server 2019 x64 | OpenVix 5.4 (Linux) | MySQL Community Server 8.0 x64 | MariaDB 10.5.8 x64 | SQLite 3.40.0 x64 | PostgresSQL 13.1 x64

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Is there a difference in the file extension .pp and .pas?
« Reply #9 on: August 30, 2016, 02:36:58 pm »
Just a hint Notepad++ DOES color both .pp and .pas files   :-X

https://notepad-plus-plus.org/

No, I just tried and it does not.
Unlike .pas, when the file has .pp, .lpr or even .dpr extension, Notepad++ editor does not assume it is Pascal source.
At least this is so with Notepad++ version 6.8.3.

Anyway, regardless of the extension, after opening the file you can tell the editor that the file is Pascal source by choosing Language->P->Pascal in main menu.

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Is there a difference in the file extension .pp and .pas?
« Reply #10 on: August 30, 2016, 02:43:58 pm »
Just a hint Notepad++ DOES color both .pp and .pas files   :-X

https://notepad-plus-plus.org/

No, I just tried and it does not.
Unlike .pas, when the file has .pp, .lpr or even .dpr extension, Notepad++ editor does not assume it is Pascal source.
At least this is so with Notepad++ version 6.8.3.

Anyway, regardless of the extension, after opening the file you can tell the editor that the file is Pascal source by choosing Language->P->Pascal in main menu.

Yes it does in newer version! I just updated to 6.9.9 and it really does!
6.8.3 was released in September 2015. and 6.9.9 in may 2016.

DanishMale

  • Jr. Member
  • **
  • Posts: 73
Re: Is there a difference in the file extension .pp and .pas?
« Reply #11 on: September 01, 2016, 09:12:31 am »
Just a hint Notepad++ DOES color both .pp and .pas files   :-X

https://notepad-plus-plus.org/

No, I just tried and it does not.
Unlike .pas, when the file has .pp, .lpr or even .dpr extension, Notepad++ editor does not assume it is Pascal source.
At least this is so with Notepad++ version 6.8.3.

My mistake that I didn't mention the version # which in my case is 6.9.2


Anyway, regardless of the extension, after opening the file you can tell the editor that the file is Pascal source by choosing Language->P->Pascal in main menu.
Lazarus 2.2.4 x64 | Windows 10 x64 | Windows Server 2019 x64 | OpenVix 5.4 (Linux) | MySQL Community Server 8.0 x64 | MariaDB 10.5.8 x64 | SQLite 3.40.0 x64 | PostgresSQL 13.1 x64

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Is there a difference in the file extension .pp and .pas?
« Reply #12 on: September 01, 2016, 10:58:28 am »
Yes it does in newer version! I just updated to 6.9.9 and it really does!
6.8.3 was released in September 2015. and 6.9.9 in may 2016.

My mistake that I didn't mention the version # which in my case is 6.9.2

The mistake was mine, as I didn't test with the latest version in first place.
Who would think that support for pp and lpr was included so recently. :)

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Is there a difference in the file extension .pp and .pas?
« Reply #13 on: September 01, 2016, 12:12:41 pm »
It was already always configurable afaik, but you had to do that yourself. Same with Geany.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018