Recent

Author Topic: Files *.pas, *.lps (created automatically), *.lpr, *.lpi  (Read 4511 times)

graemejc

  • New Member
  • *
  • Posts: 33
Files *.pas, *.lps (created automatically), *.lpr, *.lpi
« on: November 17, 2018, 03:04:58 pm »
I was an "experienced" Pascal programmer in the 1980s and left the profession in the early 1990s and am now trying to write some useful programs. But I'm a bit stuck with Lazarus.

I create a file project1.pas.

Lazarus(?) creates a file in notebook called project1.lps which opens in notebook. Not sure what that file is meant to do and it doesn't really create much confusion for me, but if someone is able to explain that to me it would be appreciated.

Lazarus also creates a files project1.lpr which seems a near-clone of project1.pas. Why?

And finally a file called project1.lpi. When I click on that it seems to want to open the project named project1. Again, not really confused about that.

I tried to search for all these extensions in the documentation provided with free pascal, but couldn't find reference to any of them.

Apologies if this is a too trivial Q. Looked for an FAQ file but couldn't find one.





graemejc

  • New Member
  • *
  • Posts: 33
Re: Files *.pas, *.lps (created automatically), *.lpr, *.lpi
« Reply #1 on: November 17, 2018, 03:30:15 pm »
It seems that editing project1.pas is ignored. I have to edit the *.lpr file???!!!

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Files *.pas, *.lps (created automatically), *.lpr, *.lpi
« Reply #2 on: November 17, 2018, 03:37:31 pm »
The information can be found here:
http://wiki.freepascal.org/File_extensions

HeavyUser

  • Sr. Member
  • ****
  • Posts: 397
Re: Files *.pas, *.lps (created automatically), *.lpr, *.lpi
« Reply #3 on: November 17, 2018, 03:37:40 pm »
I was an "experienced" Pascal programmer in the 1980s and left the profession in the early 1990s and am now trying to write some useful programs. But I'm a bit stuck with Lazarus.

I create a file project1.pas.

Lazarus(?) creates a file in notebook called project1.lps which opens in notebook. Not sure what that file is meant to do and it doesn't really create much confusion for me, but if someone is able to explain that to me it would be appreciated.

Lazarus also creates a files project1.lpr which seems a near-clone of project1.pas. Why?

And finally a file called project1.lpi. When I click on that it seems to want to open the project named project1. Again, not really confused about that.

I tried to search for all these extensions in the documentation provided with free pascal, but couldn't find reference to any of them.

Apologies if this is a too trivial Q. Looked for an FAQ file but couldn't find one.
a bullet type explanation of file types. http://wiki.freepascal.org/file_types

Depending on how you create your application/project various file types come in to play.
here is a tutorial http://wiki.freepascal.org/Lazarus_Tutorial
here is a tutorial from a user I just found https://www.win.tue.nl/~wstomv/edu/lazarus/dev_gui_app.html

Are you interested in a gui application or you want to start with a console application to get back in programming?

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: Files *.pas, *.lps (created automatically), *.lpr, *.lpi
« Reply #4 on: November 17, 2018, 03:47:50 pm »
The Lazarus IDE creates some files on its own to maintain your project...

The lpr is the Lazarus project file and thus the main file of your application.

lpi is the Lazarus information file on your project which contains all sort of things like settings
to your project etc... These settings are used to decide on how your code is built and how your working
environment for this project is setup... Sometimes things go wrong with this file and you need to reset it.

 if you came from the days of no IDE or minimal then it can be disoriented to be introduced to an IDE which
makes things much easier..

 These files are needed to manage your point and click of your objects at design time so you can visually
create an app. for the most part they are used for the IDE only to manage your code for your point and click
of building apps.


The only true wisdom is knowing you know nothing

graemejc

  • New Member
  • *
  • Posts: 33

graemejc

  • New Member
  • *
  • Posts: 33
Re: Files *.pas, *.lps (created automatically), *.lpr, *.lpi
« Reply #6 on: November 17, 2018, 07:19:31 pm »
I was an "experienced" Pascal programmer in the 1980s and left the profession in the early 1990s and am now trying to write some useful programs. But I'm a bit stuck with Lazarus.

I create a file project1.pas.

Lazarus(?) creates a file in notebook called project1.lps which opens in notebook. Not sure what that file is meant to do and it doesn't really create much confusion for me, but if someone is able to explain that to me it would be appreciated.

Lazarus also creates a files project1.lpr which seems a near-clone of project1.pas. Why?

And finally a file called project1.lpi. When I click on that it seems to want to open the project named project1. Again, not really confused about that.

I tried to search for all these extensions in the documentation provided with free pascal, but couldn't find reference to any of them.

Apologies if this is a too trivial Q. Looked for an FAQ file but couldn't find one.
a bullet type explanation of file types. http://wiki.freepascal.org/file_types

Depending on how you create your application/project various file types come in to play.
here is a tutorial http://wiki.freepascal.org/Lazarus_Tutorial
here is a tutorial from a user I just found https://www.win.tue.nl/~wstomv/edu/lazarus/dev_gui_app.html

Are you interested in a gui application or you want to start with a console application to get back in programming?

THanks for that.

Yes, at the moment, I'm going to stick to console applications for my own use. I left computing before MS began using gui's. Apple had them, but I hated them. Everything I needed to do then I could more easily do with a console application. I can, unfortunately, envisage that if I ever want to make commercial use of my programs, then I'll have to use gui's. I'll just stick to writing stuff for my own use in the short term.

graemejc

  • New Member
  • *
  • Posts: 33
Re: Files *.pas, *.lps (created automatically), *.lpr, *.lpi
« Reply #7 on: November 17, 2018, 07:23:39 pm »
The Lazarus IDE creates some files on its own to maintain your project...

The lpr is the Lazarus project file and thus the main file of your application.

lpi is the Lazarus information file on your project which contains all sort of things like settings
to your project etc... These settings are used to decide on how your code is built and how your working
environment for this project is setup... Sometimes things go wrong with this file and you need to reset it.

 if you came from the days of no IDE or minimal then it can be disoriented to be introduced to an IDE which
makes things much easier..

 These files are needed to manage your point and click of your objects at design time so you can visually
create an app. for the most part they are used for the IDE only to manage your code for your point and click
of building apps.

Thanks for that.

Yes, I "came from the days of no IDE or minimal" and yes, it IS disorienting to use an IDE which makes things much harder in the short term. I'll have to take your word that it is easier in the long term. :) :D :o

creaothceann

  • Full Member
  • ***
  • Posts: 117
Re: Files *.pas, *.lps (created automatically), *.lpr, *.lpi
« Reply #8 on: November 17, 2018, 09:32:26 pm »
Just use Lazarus to create a new project, either "Simple Program", "Program" or "Console application".

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Files *.pas, *.lps (created automatically), *.lpr, *.lpi
« Reply #9 on: November 17, 2018, 10:29:47 pm »
A note re:
[. . .]
I create a file project1.pas.
[. . .]
Lazarus also creates a files project1.lpr which seems a near-clone of project1.pas. Why?
and
It seems that editing project1.pas is ignored. I have to edit the *.lpr file???!!!

When you open or import (with "create project from file") a normal .pas program, Lazarus creates a new project from it and renames the main program to .lpr. If, like me, you prefer simple, console program sources to have the .pas extension, simply use "File -> Save As ..." to save whatever.lpr to whatever.pas; this way Lazarus updates all the references in the project's info file whatever.lpi, the project's session file whatever.lps (if any), etc. From then on you'll be using whatever.pas (see image for reference).

But remember Murphy's Law and backup your original files!  :D
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018