Free Pascal Program Tutorial 1 – Getting Started – Lazarus Download Link – Mac Windows Linux


SchoolFreeware’s Free Pascal Program
Tutorials Tutorial 1 Getting Started. This new tutorial series replaces the Free
Pascal Tutorial Series. This new tutorial series includes more examples and topics to better meet the educational
requirements of students and teachers working with Pascal. There are two Free Pascal Lazarus Tutorial Series
available at SchoolFreeware, at the time for this video. This one is
the Program Series which works with the command line
interface and the other is the App Series which makes GUI or window type applications. The
code used within this series can be downloaded at SchoolFreeware.com. The series will
use the Free Pascal Compiler version 2.4.2 and Lazarus IDE version 9.30 32-bit. The Lazarus IDE with the Free Pascal
compiler works with Windows, Mac and Linux. It is similar to Turbo Pascal and Delphi. Lazarus with the Free Pascal compiler is a free download at lazarus.freepascal.org This is the Lazarus IDE and it
automatically start of with the windows type application
ready for programming however we are going to use the program part of Lazarus. So, I will go to File New and I will select program – here. Click OK. We are ready to start programming using the
command-line interface What we have here is the source editor.
The source editor is where you would put your code. If the source editor happens to be closed. You can always bring it back by going to view – source editor. Automatically Lazarus
has placed in some code for us and we are not going to make any
modifications to this code that Lazarus has put in. Towards the
bottom you find begin and end. This is we’re
going to put our code for our first program. I’ll start by writing to the screen. write line (writeln) then open parenthesis a single quote and
I’ll tell the computer to print This is the first program Another single quote Close parenthesis and semicolon. Anything within the single quotes as a
string – as you see here and the computer will write to the
screen verbatim whatever is within the
single quotes. So, I will go ahead and run. The project is successfully built and execution is stopped immediately. So, what has happened here is
the computer wrote to this line to the screen and immediately closed the window. So, what I
have to do is tell the computer to stop so that way I can see what’s going on. I’ll use the command read line (readln). The computer all pause until an enter key has been processed. I’ll go ahead and run. Alright, we got – this is the first program – Press enter the program now stops. What I would like to do is
place a couple of write lines so I can make a few spaces and I’ll have write line (writeln) Press enter to quit. If you are on a Macintosh you can have press
return to quit. So now I will go ahead and run. The computer is paused waiting for the
enter to be pressed. Alright, I’m going to make a little
modification to the program. I am going to write another line write line (writeln) This is another line. OK, I’ll go ahead and run Now we have two lines of text at the top. If I were to make modifications the program – Instead of using write line – I’ll use the command write. What will happen is this command write
will simply write verbatim whatever is within the single
quotes and will not make a new line. When I go ahead and run this we find that the two lines are actually
smashed together because I told the computer not to make a new line. I’ll go ahead and change it back. Run once more. Everything looks good. Ok I’ll go ahead and save this program and then I’ll go ahead and build
it. Go to File – go to Save I’ll place on the Desktop – New Folder You can put your folder wherever you
wish. I’ll call this new folder FPProgT1 for Free Pascal
program tutorial 1 i’ll go inside a folder and call the project
file FPProgT1 and I’ll go ahead and save. Ok. On the Desktop (In the Folder) – Here we have two files both are type Lazarus project information.
If I right-mouse click on the first one and go to properties I find this one has the
extension lpi and if I were to open up with Notepad – This is the XML for this program within Lazarus. I don’t want to mess
with the XML. The other file – properties. We find that this is an LPR
file. If I were to open this up with Notepad, I’ll
find that this is the actual code that we just got done working with. Okay, now
the program is saved, I like to go ahead build is. I am going back into Lazarus I’m going to go into Run and I am
going to Build My message says that Project1 has been successfully built. Here we should find the application
file. Here it is. This is the executable that we
just got done building. If I were to double-click – There’s our program.
This application a stand-alone. If I were to place it on the desktop I can run it straight from the desktop or any other place on the computer. There is the executable. OK, for the
next tutorial we will work with some mathematics

Leave a Reply

Your email address will not be published. Required fields are marked *