09.10.2014 Views

download pascal tutorial (pdf - Tutorials Point

download pascal tutorial (pdf - Tutorials Point

download pascal tutorial (pdf - Tutorials Point

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table of Contents<br />

Pascal Tutorial .......................................................................... i<br />

Audience ................................................................................... i<br />

Prerequisites ............................................................................. i<br />

Compile/Execute Pascal Programs ........................................... i<br />

Copyright & Disclaimer Notice ................................................... i<br />

Pascal Overview ...................................................................... 1<br />

Features of the Pascal Language? .................................................................. 1<br />

Facts about Pascal ........................................................................................ 1<br />

Why to use Pascal? ....................................................................................... 2<br />

Environment ............................................................................. 3<br />

Installing Free Pascal on Linux ....................................................................... 4<br />

Installing Free Pascal on Mac ......................................................................... 4<br />

Installing Free Pascal on Windows ................................................................. 4<br />

Text Editor ................................................................................................... 4<br />

Program Structure .................................................................... 6<br />

Pascal Hello World Example .......................................................................... 7<br />

Compile and Execute Pascal Program: ............................................................ 8<br />

Basic Syntax ............................................................................ 9<br />

Functions/Procedures ................................................................................ 9<br />

Comments ................................................................................................. 9<br />

Case Sensitivity ....................................................................................... 10<br />

Pascal Statements ................................................................................... 10<br />

Reserved Words in Pascal....................................................................... 10<br />

Character set and Identifiers in Pascal .................................................... 10<br />

Data Types ............................................................................. 12<br />

Pascal Data Types: .................................................................................. 12<br />

Type Declarations: ................................................................................... 13<br />

Integer Types ........................................................................................... 13<br />

Constants................................................................................................. 14<br />

Enumerated types .................................................................................... 14<br />

Subrange Types ...................................................................................... 15<br />

Variable Types ....................................................................... 16<br />

Basic Variables in Pascal ........................................................................ 16<br />

Variable Declaration in Pascal ................................................................. 17<br />

Variable Initialization in Pascal ................................................................ 18<br />

Enumerated Variables ............................................................................. 19<br />

Subrange Variables ................................................................................. 19<br />

Constants ............................................................................... 21<br />

iii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!