Copying a Pascal Program into Lazarus

  1. Start Lazarus by double-clicking on its Launch icon You should be able to find a launch icon like this on your desktop, or by using the Start button.

    After Lazarus has started, you will see the following menu bar:


    The Lazarus Menu Bar, with 'Project' circled in purple to help you find it.

  2. On the menu bar click on Project.
    'Project' is circled in purple in the graphic above.

    A drop-down menu will appear:


    The Project menu

  3. On the drop-down menu, click on New Project ....

    The Create a new project dialogue appears:


    The Lazarus 'Create a new project' dialogue, with 'Program' selected

  4. Click on Program in the list of options, as shown above, and then click on the OK button.

    You may see the following Project changed dialogue:


    Lazarus 'Project changed' dialogue, which may or may not appear, depending on circumstances

  5. If do see the above Project changed dialogue, just click on the No button.
    (It was a brand new project and so nothing valuable will be lost).
    If you do not see the above dialogue you do not need to do anything in this step.

    You should now be able to see a new project in the Source Editor


    A new project in the Source Editor, with nothing between the begin and end

  6. In your browser, navigate to the page containing the Pascal program you want to copy.
  7. Copy the code into the clipboard by selecting it then pressing CTRL+C, as follows:
    1. Use the mouse to position the cursor before the 'p' of 'program' in the first line
    2. Drag the cursor with the left mouse button down until the cursor is positioned just after the final full stop after 'end.'
    3. Press CTRL+C
  8. In Lazarus, select all the text in the editor.
  9. Press CTRL+V to replace all of this text with the copied Pascal code.
  10. Carefully check that all the Pascal code is now in the Lazarus editor. Check that there are neither extra, nor missing characters at the beginning and end.
  11. Save the file by selecting menu item Project > Save Project As...
  12. Navigate to a suitably named new folder and save the file with the name given in the first line of the program.

The program is now available for you to edit and run. Remember that student programs may require some adjustment before they will compile and run successfully. (We have tested all of them, but sometimes changes to compilers necessitate minor alterations to the original code).

Experiment with the program. See what improvements you can make.

If you want to, you can quit from Lazarus by selecting menu item File > Quit

Programming - a skill for life!

How to install and set up Lazarus to create, edit and run Pascal programs