Recent

Author Topic: running single files on lazarus  (Read 2903 times)

ssliackus

  • Jr. Member
  • **
  • Posts: 65
running single files on lazarus
« on: September 16, 2018, 03:08:11 pm »
Hi guys,


I have very basic program with two files (both are *.pas endings one is main other is unit code), writen in text editor. I compile and run these with 'fpc 2.pas', but I have trouble when I want to run these from Lazarus IDE. I start 'New Simple Program', which give me empty lpr file, so the only way for me to run code is paste pas into lpr file. I understand that I am doing something wrong, but I do not know what is the proper way of running very simple program in Lazarus (.
Any advise on that? Or it would be the best if there would be a tutorial on proper lazarus project management.

Thanks

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: running single files on lazarus
« Reply #1 on: September 16, 2018, 03:23:57 pm »
Use file->open.
The IDE will detect that the pas file is indeed a program and asks you to make a project for it.
Click OK.
In the dialog you now get select "Simple Progream" and click OK.
The IDE will now make a project file for the program and open the program file in the editor.

The dialog is a bit confusing, not sure if it is necessary, but there you go.

Bart

ssliackus

  • Jr. Member
  • **
  • Posts: 65
Re: running single files on lazarus
« Reply #2 on: September 16, 2018, 05:44:06 pm »
Can I start Lazarus without any Project loaded?

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: running single files on lazarus
« Reply #3 on: September 16, 2018, 06:25:56 pm »
Can I start Lazarus without any Project loaded?

Yes, but it then will show a modal dialog to select a project--whether a new one, open an old one, etc.---and won't let you do anything else until a project is opened.
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.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: running single files on lazarus
« Reply #4 on: September 16, 2018, 06:28:33 pm »
Can I start Lazarus without any Project loaded?
No. Session info is part of a project. However you can have a non-saved "virtual" project and even run it, thus it is not really a problem.

The modal dialog mentioned by lucamar was added because people wanted a way to close a project. You cannot do anything useful while the dialog shows.
« Last Edit: September 16, 2018, 06:33:21 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018