Write the first program in Pascal's Hello World with Lazarus

Source: Internet
Author: User

The process of installing the Lazarus does not have to say much, it is a fool-style.

Opening Lazarus,lazarus automatically creates a new window-form application. You will see five of Windows.

Main Window

This window displays a title bar, a menu bar, and a toolbar.


Object View Window

This window displays property information for the form and form created


Source Code Editing window

This window is used to view and edit source code


message window

This window displays information about the compilation run


Form1 window created by default

This is the new application auto-created

Well, introduce so much, below to get to the chase.

Turn off the four windows outside the main window first. You may be prompted when you turn off Form1, click No

1. New Program Project

Project-->new Project (Project--new project, some may translate to project--new projects)


Select Program, click OK

If Save changes Dot No


OK, the source Code editing window will automatically pop up below

2. Edit Run

Fill in the following between Begin and end

  Writeln (' Hello world! ');  

The complete code is as follows

Program Project1; {$mode OBJFPC} {$H +}uses  {$IFDEF unix}{$IFDEF usecthreads}  cthreads,  {$ENDIF} {$ENDIF}  Classes  {You can add Units after this};begin  writeln (' Hello world! ');  Readln;end.

Then click the Green Triangle button in the main window to run

If you write a program that does not have a problem, the message window prompts the compilation to succeed

The console will then pop up to show the problem we're going to output


Since we are only using the output for the time being, we can delete the second line behind the begin

After deletion

The complete code is as follows

Program Project1;begin  writeln (' Hello world! ');  Readln;end.  
Click the green triangle again to run.

At this point, the first program is finished debugging.

3. Save

The saved file is in LPR format, not in PAS format. The LPR format contains information about the form, compile, run, and so on, in addition to the source code information.


Write the first program in Pascal's Hello World with Lazarus

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.