Installing Lazarus plus Free Pascal as a Windows Pascal

One of the advantages of Lazarus is that you can write once and compile anywhere. Well, I want to create a CGI program with Lazarus and to do that I need something called FreeSpider, a Lazarus package for creating CGI programs (those are the programs that are running on your Internet server, most likely under Linux).

To be able to download FreeSpider, I needed the latest version of Lazarus, which is 0.9.28.3 to work with the latest stable version of Free Pascal, which is 2.4.0. Going to download Lazarus from SourceForge, gave me the proper version of Lazarus but coupled with the previous valid version of Free Pascal, namely 2.2.4. I tried to install one version of Lazarus and connect it with the standalone version of Free Pascal, but that did not work.

I dug deeper, and found a place from which you can download the latest snapshot of both Lazarus 0.9.28 and FPC 2.4.0. I installed it and yes, it worked perfectly, the very first time I tried it. Here is the code of that simplest of all simple Lazarus programs:

—————————-

program prvodugmepoc;

{$mode objfpc}{$H+}

uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, nulaprvodugme, LResources
{ you can add units after this };

{$IFDEF WINDOWS}{$R prvodugmepoc.rc}{$ENDIF}

begin
{$I prvodugmepoc.lrs}
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

unit nulaprvodugme;

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls;

type

{ TForm1 }

TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;

var
Form1: TForm1;

implementation

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text := ‘Prvo dugme’;
end;

initialization
{$I nulaprvodugme.lrs}

end.

—————————-

This code has one button and one changeable text field; clicking on the button changes the text in the text field — and it works!

Interestingly enough, this same code should be working on Lazarus under Ubuntu, of which I do have a dual boot. So Lazarus with Free Pascal is not only a Windows Pascal, it is also an “international” pascal, meaning it will feel right at home with totally disparate hosts such as Windows and/or Ubuntu.

Posted in Lazarus | Tagged , , , , , , , , , , , , , , | Leave a comment

Important Links for Lazarus and Free Pascal

Here is the free Lazarus list.

Here is the main Lazarus site. It actually is a forum.

FreePascal main site

Current version of FreePascal compiler is here.

Download mirrors for FreePascal.

Lazarus support, a site by a company that has a commercial interest in supporting Lazarus, as an open source project.

Posted in Lazarus | Leave a comment

Lazarus Free Pascal Tutorial 2 Printing Math

This entry is part 2 of 2 in the series Lazarus Pascal Tutorials

Computers compute and programming languages enable us, humans, to tell them what to compute for us. Free Pascal stays true to classical Wirth’s Pascal and in this video you will see how you can print the addition and subtraction of two numbers, the old terminal school style:


YouTube Direct

In the end, you will see how to format floating point numbers so that the decimal places line up.

Posted in Lazarus Pascal Tutorial | Tagged | Leave a comment

I dalje radim horoskope…

Ako ste dovde došli preko Googla, znajte da i dalje radim horoskope, jedino što se to dešava na sajtu AstroDule.com. No možemo biti i malo precizniji:

Kliknite ovde ako vas sa sajta AstroDule interesuje medicinska astrologija.

Kliknite ovde ako vas sa sajta AstroKursevi.com interesuje Reiki terapija ili
kurs za Reiki.

Kliknite ovde ako vas sa sajta AstroDule interesuju ljubavni horoskopi, brak i razvod.

Posted in Astrologija i horoskopi | Tagged , , , , , , , | Leave a comment

Lazarus Free Pascal Tutorial 1 What are Free Pascal and Lazarus

This entry is part 1 of 2 in the series Lazarus Pascal Tutorials

I have found an awesome series of Free Pascal tutorials using Lazarus, on YouTube. The series starts with the basics, what a free pascal actually is. Here it is:


YouTube Direct

Lazarus is an IDE for Free Pascal, that is, it is a working environment. Once you get hold on Lazarus on one platform, you can use it on other platforms just as well. The motto of Lazarus is Write Once, Compile Anywhere! and it actually holds on to that promise!

Posted in Lazarus Pascal Tutorial | Tagged , , , , , , , | Leave a comment