Recent

Author Topic: Pascal Programming Tutorials  (Read 18484 times)

mrw

  • New Member
  • *
  • Posts: 13
Pascal Programming Tutorials
« on: August 13, 2009, 04:06:14 pm »
Learn Pascal Programming Tutorials

     These tutorials: 1) use Free Pascal Compiler (FPC)
                           2) Work well with Lazarus
                           3) Are concise
                           4) Have been tested and contain only minor errors.
                           5) Are recommended. (One can skip Lesson 2)
                           
     Lesson 1 - Introduction to Pascal
     Lesson 2 - Colors, Coordinates, Windows and Sound
     Lesson 3 - Variables and Constants
     Lesson 4 - String Handling and Conversions
     Lesson 5 - Decisions
     Lesson 6 - Loops
     Lesson 7 - Arrays
     Lesson 8 - Types, Records and Sets
     Lesson 9 - Procedures and Functions
     Lesson 10 - Text Files
     Lesson 11 - Data Files
     Lesson 12 - Units
     Lesson 13 - Pointers
     Lesson 14 - Linked Lists

http://www.learn-programming.za.net/learn_pascal_programming.html

mrw

  • New Member
  • *
  • Posts: 13
Re: Pascal Programming Tutorials
« Reply #1 on: August 13, 2009, 04:52:37 pm »
"Pascal Now is a site devoted to Pascal programming."
{ ... but perhaps not all that devoted (grin)}

The site has good reference sections
but tutorials are not its strength.
I'd recommend new users flip through the site map to
get a feel of what the site can offer you.

The site is active.

Might consider contacting site author re: Lazarus

Link
http://pascal.comsci.us/

Lessons
Integer Arithmetic in Pascal
A Pascal Program with Output

Reference Sections
  * Etymology - { definition }
        1 : the history of a linguistic form (as a word)
          shown by tracing its development since its
         earliest recorded occurrence in the language
         where it is found, by tracing its transmission
         from one language to another, by analyzing it
         into its component parts, by identifying its
         cognates in other languages, or by tracing it
         and its cognates to a common ancestral form
         in an ancestral language
         
      Character Set
      Comments -Pascal Etymology
      Etymology
      Keywords - Pascal Etymology
      Literal Constants
      Multiplication Operator - Operators
      Operators
      Types
      Variables

  * Syntax           //  pretty good section
  * Development   //  empty
  * Resources      //   pretty good section
       - Freeware/Shareware Compilers
       - Commercial Compilers
       - Lists on Other Sites


http://pascal.comsci.us/

Lord_ZealoN

  • Full Member
  • ***
  • Posts: 141
    • http://lordzealon.com
Re: Pascal Programming Tutorials
« Reply #2 on: August 13, 2009, 05:34:46 pm »
You have some link to Object Pascal? I'm more interested in the part of OOP with and without taking in count GUI.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: Pascal Programming Tutorials
« Reply #3 on: August 13, 2009, 05:51:16 pm »
@Loard_ZealoN
Here is imho a very good short intro. Unfortunately (for you, I guess) it's in german language.
But maybe with translate.google.com ...

http://www.delphi-treff.de/tutorials/objectpascal/delphi-crashkurs/page/8/

mrw

  • New Member
  • *
  • Posts: 13
Re: Pascal Programming Tutorials
« Reply #4 on: August 13, 2009, 11:27:56 pm »
(._.?)

Delphi was Borland's Object Pascal.
Units are the reuseable chunks of code that I associate with OOP



Using commands from units
Extract from http://www.learn-programming.za.net/programming_pascal_learn01.html

The commands that are built into your Pascal compiler are very basic and we will need a few more. Units can be included in a program to give you access to more commands. The crt unit is one of the most useful. The ClrScr command in the crt unit clears the screen. Here is how you use it:

Code: [Select]
program Hello;
 
uses
   crt;
 
begin
   ClrScr;
   Write('Hello world');
   Readln;
end.



Object Oriented Programming (OOP) tutorial
http://www.geocities.com/SiliconValley/Park/3230/pas/pasles03.html
Chapter 1 -- Object Oriented Programming Philosophy Part 1
Here we talk about the concepts of encapsulation, the very basic construct of an object, and "public" and "private" stuff.
http://www.geocities.com/SiliconValley/Park/3230/pas/pasl3001.html

Chapter 2 -- Object Oriented Programming Philosophy Part 2
Here we talk about the concept of constructor and destructor.

Chapter 3 -- Object Oriented Programming Philosophy Part 3
Now we move on to the concept of inheritance, method overloading, and protected keyword.

Chapter 4 -- Object Oriented Programming Philosophy Part 4
Going on virtual functions, abstract classes, and polymorphism.

Chapter 5 -- Linked List in OOP
An example on how to make a linked list in Pascal OOP.



Historic Link
http://www.mactech.com/articles/mactech/Vol.02/02.12/ObjectPascal/

Object Pascal

Object Pascal is an extension to the Pascal language that was developed at Apple in consultation with Niklaus Wirth, the inventor of Pascal. It is descended from an earlier attempt at an object-oriented version of Pascal called Clascal, which was available on the Lisa computer. MacApp itself is descended from the Lisa Toolkit, an application framework for creating Lisa applications. The Lisa Toolkit was written in Clascal.
....

(^_^)

Hope these links help.

mrw

  • New Member
  • *
  • Posts: 13
Re: Pascal Programming Tutorials
« Reply #5 on: August 13, 2009, 11:50:05 pm »
Thanks Theo

I find your link
http://www.delphi-treff.de/tutorials/objectpascal/delphi-crashkurs/page/8/
very useful.

Plus your suggestion to translate it with google.com ...
worked well for me ... I am still reading the article.
Sample translation follows ...

Object-Oriented Programming

Delphi was "Object Pascal". This name implies a functionality, which in the world of programming is not hard to imagine: the object-oriented programming, (OOP). I can understand why this kind of programming is not discussed in the detail it deserves, we could all write books about OOP.

However, this would not be a crash course in Delphi, if OOP had no place in it. And so I will offer a brief introduction to OOP. Next I will show how OOP was implemented in Delphi and how it can be used. The beginning may be somewhat theoretical, ...

mrw

  • New Member
  • *
  • Posts: 13
Re: Pascal Programming Tutorials
« Reply #6 on: August 14, 2009, 06:48:58 am »
 Lazarus Pascal Programming Tutorial - Pointers
 (The lesson is coded as console program that present 3 screens of info. One can cut and paste the code into Lazarus to compile and run the code.)                                         
 
 A "pointer" is a type of variable that stores a memory address.
                                                                 
   There are 2 types of pointers                               
        1) typed   ... points to a variable such as an integer   
       2) untyped ... can point to any type of variable.

Code: [Select]
program LESSON_POINTERS;

uses
  Classes,CRT;

procedure  newpage;
 begin
  Writeln;
  Writeln ('  _________________________');
  Write   ('  Press any key to continue');
  Readln;
  ClrScr;
  Writeln;
 end;


begin
  Writeln ('  Lazarus Pascal Programming Tutorial - Pointers');
  Writeln ('                                                ');
  Writeln ('  A "pointer" is a type of variable that stores a memory address.');
  Writeln ('                                                                 ');
  Writeln ('    There are 2 types of pointers                                ');
  Writeln ('        1) typed   ... points to a variable such as an integer   ');
  Writeln ('        2) untyped ... can point to any type of variable.');
 newpage;
  Writeln ('  Declaring a Pointer                                    ');
  Writeln ('                                                         ');
  Writeln ('  To declare a typed pointer put a ^ in front of the variable type.');
  Writeln ('                                                         ');
  Writeln ('program Pointer010;                                      ');
  Writeln ('     // Declaring a Pointer                              ');
  Writeln ('var                                                      ');
  Writeln ('   p: ^integer;                                          ');
  Writeln ('                                                         ');
  Writeln ('begin                                                    ');
  Writeln (' // pointer was declared in var section                  ');
  Writeln (' // pointer was formed by putting a ^ in front of integer');
  Writeln ('end.                                                     ');
 newpage;
  Writeln ('  Getting Memory Address for a Variable to Assign to Pointer');
  Writeln ('                                      ');
  Writeln (' @ sign can be used in front of a variable to get its memory address');
  Writeln (' Since pointers store memory addresses');
  Writeln (' This memory address can then be stored in a pointer ');
  Writeln ('                       ');
  Writeln (' program Pointer020;   ');
  Writeln ('                       ');
  Writeln (' var                   ');
  Writeln ('    i: integer;        ');
  Writeln ('    p: ^integer;       ');
  Writeln ('                       ');
  Writeln (' begin                 ');
  Writeln ('     p := @i;          ');
  Writeln (' end.                  ');
 newpage;
end.

mrw

  • New Member
  • *
  • Posts: 13
Re: Pascal Programming Tutorials
« Reply #7 on: September 04, 2009, 07:22:27 am »
An English Translation of a Intro Delphi Tutorial (German) adapted to match Lazarus.

The tutorial works through naming a project and creating a form for a simple adding program.

Put the tutorial up as a pdf  on  box.net [pretty fast &  free download service]
Code: [Select]
http://www.box.net/shared/7dv2kolazf
@theo
Thanks for the suggestions.

Quote
Here is imho a very good short intro. Unfortunately (for you, I guess) it's in german language.
But maybe with translate.google.com ...

http://www.delphi-treff.de/tutorials
« Last Edit: September 04, 2009, 09:16:42 am by mrw »

 

TinyPortal © 2005-2018