Introduction
PASCAL is a programming language named after the 17th century mathematician Blaise Pascal. The Pascal language

Strict rules make it difficult for the programmer to write bad code! A program is a sequence of instructions which inform a computer of a required task.

Basic format of every Pascal program
Every Pascal program has the same essential format, which is illustrated below,


	program TITLE ( input, output );
	begin
	  program statements;
	  program statement
	end.

program is the first word of all Pascal programs. It is a keyword (Keywords are reserved, ie, you cannot use keywords to describe variables). Keywords are used to implement the language.

TITLE is the name the programmer gives to the Pascal program being written. It is an identifier. Identifiers begin with a letter, then followed by any digit, letter or the underscore character ( _ ). Identifiers are used to give names to user defined variables and methods used to perform operations.

(input, output) states what the program will do, ie, input and/or output data. Data is inputted from the keyboard, and outputted to the console screen.

begin defines the starting point of the program, and provides a means of grouping statements together (i.e. all statements between a begin and end are considered part of the same group or block). Program statements are commands or instructions to the computer which perform various tasks.

end. This must always be the final statement of a Pascal program.

ALL PROGRAM STATEMENTS AND LINES ARE TERMINATED WITH A SEMI-COLON, EXCEPT THE BEGIN AND END KEYWORDS. PROGRAM STATEMENTS PRECEEDING AN END STATEMENT DO NOT REQUIRE A SEMI-COLON.


Some valid keywords which implement Pascal are,

	Integer		Char		Record
	Case		Real		If
	While		With		Else

In addition, Pascal is NOT case sensitive. That means Else and else are treated the same.

SELF TEST 1. Which of the following are valid Pascal identifiers?

	 birthday     Too_hot?        First_Initial
	 grade        1stprogram      down.to.earth
	 see you      OldName         case
	Click here for answers

© Copyright B Brown/P Henry, 1988-1999. All rights reserved.