This tutorial will teach you the absolute basics of Pascal!
Requirements:
A Windows Based Operating System (32bit)
A Compiler, there are plenty available free free pascal compilers - Google Search
Lets get started:
There are a few things you need to remember when coding in Pascal; After each line we put a space to make it easier when debugging for errors and it also just creates and nice overall house style for the code, we also indent IF statements to make it easier to spot and again a better overall house style and feel, remember this! It will help you in later tutorials.
Open your Pascal Editor/Compiler and begin by typing this code
PROGRAM MyFirstApplication;This will define the name to identify your program, you MUST remember to put a ; at the end of every line of code in Pascal!
USES Wincrt;Here we are going to tell the code to use the Windows Environment when running
BEGINThis tells pascal we have begun the code for the application!
Writeln('Hello This is my first Pascal Application');
Writeln tells Pascal to write the line within the ('') perimeters’, this will be the text that’s shown in the end programNow we will tell the program that its the end of the programming code, there must be a full stop after the last End. in the program, you may use End in an IF statement which will not specify the end of the program code because it has no full stop, we will come back to IF statements in a later tutorial!
End.The code should now look like this:
PROGRAM MyFirstApplication;
USES Wincrt;
BEGIN
Writeln('Hello this is my first Pascal application');
END.
The end program should look like this:
http://sparkfusion.i...9/12/pascal.bmp
Edited by Bioshox, 02 February 2010 - 02:03 AM.
delete spam link


Sign In
Create Account


Back to top









