Flag This Hub

Lazarus for Windows (and Linux)

By


See all 3 photos

What is Lazarus?

Lazarus is an integrated development environment (IDE) for programming in the Pascal language. It looks very similar to Visual Basic, Delphi and CBuilder. Not only is it available for the Linux operating system but also for Windows. It is open source and FREE to download and use by anybody. It utilises the Free Pascal Compiler to develop programs for Windows and Linux (note that Lazarus must be installed on both operating systems).

Being so similar to Delphi means that what you may know about Delphi can be used in Lazarus too. For example, the code for adding the application title to the main form is exactly the same.

The IDE will also offer a certain degree of auto completion making programming even quicker and pointing you in the right direction for selecting functions.

Caption on Titlebar

procedure TForm1.FormCreate(Sender:TObject)
begin
// Adds caption to form titlebar

	Form1.Caption =: Application.Title;

end;
Lazarus on Windows 7
Lazarus on Windows 7

How to use Lazarus

Just as in Visual Basic, Delphi and CBuilder, projects start off with simple 'Forms'. These can be thought of as blank window templates to which the programmer adds components selected from a toolbar within the IDE. Some of the components are familiar, such as Button, Toolbar, StatusBar and Menu. Others are more specialised allowing access to working with databases or providing sockets to communications and internet services.

The programs source code is made up of 'Units' that can be self written and reused across other projects, which is useful if you have a self written favourite routine or function that you want to use.

The Pascal language

Pascal is one of the easiest programming languages to learn having an easy to understand syntax. It is also object oriented, hence the references to Sender and Object in using the components.

Most of what you see in Windows is made up of objects that interact through messages and events. Clicking on a button is an event, the button will then 'send' a message to the system to perform a process - your own code maybe - based on the result of the event. The Object inspector in Lazarus shows the available events for each component.

IDE settings panel
IDE settings panel
Source: http://my PC

IDE Settings


In the Linux version, it is very important that the fpc sources are in the correct directory otherwise Lazarus will complain that it cannot find the sources and will not work properly. You will then need to open the IDE settings dialog and navigate to where the fpc sources have been unpacked (unzipped).

In the Windows version, this is all taken care of automatically and Lazarus will work without any further alterations. I have run Lazarus on Windows XP and Windows 7 successfully.

Learn Object Pascal with Delphi
Amazon Price: $49.95
Essential Pascal
Amazon Price: $24.01
List Price: $29.50
Delphi 2009 Handbook
Amazon Price: $38.05
List Price: $48.50

Comments

No comments yet.

Submit a Comment
Members and Guests

Sign in or sign up and post using a hubpages account.



    Like this Hub?
    Please wait working