We may earn an affiliate commission when you visit our partners.
Course image
Udemy logo

Learn To Program with Delphi and Object Pascal

Huw Collingbourne

Simply the fastest way to learn to program Object Pascal – either with the industry-standard Delphi system on Windows or with the multi-platform Lazarus and Free Pascal. Just drag-and-drop, click and code.

Read more

Simply the fastest way to learn to program Object Pascal – either with the industry-standard Delphi system on Windows or with the multi-platform Lazarus and Free Pascal. Just drag-and-drop, click and code.

The knowledge you gain will give to entry to the world of commercial application development using Lazarus or Delphi.

Delphi has an elegant drag-and-drop IDE with lots of integrated coding and debugging tools. You can download a free copy of Delphi for Windows, or you can use the free, open-source Lazarus IDE for designing and coding languages on Windows, Mac or Linux. Full source code of all the example projects is provided with this course.

What you will learn:

  • The fundamentals of programming – from the ground up

  • Object orientation – its principles and practice

  • The Object Pascal language – for neat, elegant, maintainable programming 

Who should take the course

  • Beginners – if you’ve never coded before, you can learn pascal step by step

  • This Pascal programming tutorial is also feasible for those Programmers who’ve used other languages – Ruby, Python or Java  but want to extend their knowledge? This is for you.

  • Cross-platform developers – with Lazarus and Free Pascal, write  on one OS, compile on a different one.

Huw Collingbourne has programmed in Object Pascal since the first release of Delphi in 1995. For over 10 years he was the Delphi programming columnist for PC Plus magazine in the UK. This course gives you in-depth instruction in programming with Delphi and the Object Pascal language.

Enroll now

What's inside

Learning objectives

  • Cross-platform development with lazarus on mac, windows or even linux
  • Downloadable source code for lazarus on windows and mac or delphi on windows
  • A 124-page ebook, the little book of pascal, explains all the topics in depth

Syllabus

Getting Started
Welcome to Learn to Program with Pascal. This video provides a quick overview of the course.
The Little Book Of Pascal (eBook)
Read more
Source Code Archive
Read Me First!
Before you begin you will need to have an Object Pascal compiler and an IDE (Integrated Development Environment) for your operating system. Here I explain where to download the free Lazarus IDE for Windows or OS X or the commercial Delphi IDE for Windows.

Using Lazarus, you can create a program, complete with its own user interface, in a matter of moments. Just follow along to write a ‘Hello world’ program.

This video shows how to load one of the sample projects supplied with this course and run it inside the Lazarus IDE. It also highlights a few of the common code elements of Object Pascal programs.

If you are wondering what all that code in a Pascal file actually does, this video should help to explain the basics. Here we take a quick first-look at Pascal code. I’ll explain the important elements in much greater detail later in this course.
Fundamentals of Pascal

Here we learn how to save the values of data items by assigning them to named ‘variables’.

Sometimes you may want to ensure that a value cannot be changed. That’s what ‘constants’ are for.

You can document your code by embedding comments. Here I show Pascal’s three alternatives comment types.

Procedures and Functions

Procedures and functions give you a way of dividing your code into named blocks for easy re-use. Here I explain the basics of procedures, functions and parameters.

When you precede parameters with the var keyword in a procedure or function, the arguments are passed ‘by reference’; rather than ‘by value’. Here I explain what that means and why it is important.

What is the difference between procedure myProcedure and procedure TForm1.myProcedure? Welcome to the world of object orientation. Here I take a first glance at ‘form methods’.

This tutorial shows an example of how a single procedure can do calculations for three different types of bank account. This illustrates the advantage of using procedures and functions to avoid repetition and keep your programs simple.

Data Types, Operators and Scope

How to you subtract grapefruits from oranges or add 10 to a sonnet? These may sound like insoluble problems. But anything is possible if you make sure you are working with compatible data types.

The compiler will check that the arguments you send to a procedure match the declared parameters in both number and type. This can save your program from encountering unexpected errors when it is run.

When you do arithmetic you’ll need to use operators such as +, -, *, /, div and mod. You can find out more about these in The Little Book of Pascal (the eBook supplied with this course) and in the demo program shown in this video. 

What is the difference between local and global scope and why does it matter? And a question: what happens when you declare two or more variables with the same name? The answer: It all depends on their scope!

Loops and Arrays

Here we find out how to repeat operations in Pascal. We start out with a for loop which lets us create a table of characters from their ASCII codes. If you want to follow along, be sure to run the ascii and ifelse projects froom the code archive.

If you find that numerous if..else tests are making your code hard to understand, consider simplifying it with a case statement. This tutorial explains how…

for loops are fine when you know in advance how many times an operation needs to be repeated. Sometimes you may not know this, however, in which case the while and repeat loops can be used, as explained here.

Here I explain how to create lists of items in the form of sequential arrays and how to iterate through the items in an array using a loop of find a single data item at a specific array index.

User-defined Types and File IO

We’ve used many standard types such as string and integer in our projects so far. You can also create your own types. This video explains how to do this and why it may be useful.

You can create complex data-types which, just like commercial database applications, wrap up multiple bits of data as the fields of a record. Here I show how to create a CD record type with fields to store the name, artist, price and label of a CD.

Using Free Pascal or Delphi IO procedures, you can read and write structured data to and from a file. Here I show how to save and load a file of CD records.

It is fairly easy to save and load text files using Delphi or Lazarus. Here I explain how to read and write characters and strings from a text file and display them in a memo or process the text and write it out to a new file. 

Object Orientation

Here we take a first look at the principles Object Orientated Programming (OOP). I’ll explain how objects are created from classes and how they may form ‘family trees’ of ancestors and descendants.

Here I explain the difference between objects and records and show how to define a simple CD class, then create CD objects by calling the class’s ‘constructor’.

There are several ways to save and load objects to disk but none of them is as simple as saving and loading records. Here I show a simple trick that lets you save data from objects to a file of records.

Class Hierarchies
Here we look at how to write your own ‘family tree’ of classes and how to initialize their data by writing constructors for each class.

Even the forms and controls, such as Buttons and Memos are objects based on Delphi or Lazarus classes, as this lesson explains.

When defining methods for Form classes or custom classes you need to enter both their definition and their implementation. Here I explain how a simple keystroke-combination can save you the trouble.

When two related classes have methods with the same name, how can you be sure that the correct method is used? Here we look at virtual and overridden methods and discover why destructors are overridden.
Properties are not restricted to visual objects such as Buttons and Memos. You can also create properties for your own objects. Here I explain how to do this and why you might want to.
In the last video I showed how to define a write accessor or ‘setter’ property. here I’ll explain how to create a read accessor or ‘getter’ property.
Exception-handling and Debugging
Exceptions are objects that wrap up errors that may occur when a program runs. Here I explain how to use exceptions to deal with unforeseen problems.
Sometimes the values of variables may be left in an uncertain state when an error occurs. Here I explain how you can use exception-handlers to ensure that critical variables are assigned meaningful values.
When your programs don’t do what you expect them to do, it’s time to use the debugger. The Delphi or Lazarus debugger can help you find and fix errors in your code. Here I show how to debug on Windows and OS X.
Going Further
The final sample project in this course is a text-based exploring game. This lets us revise many Object Pascal features and create a class hierarchy of game objects. 
The adventure game introduces one important new feature: serialization. Using Object Pascal Stream classes I show how you can save and load complex networks of objects to and from disk.
Additional Resources
Now you’ve arrived at the end of this course, where do you go next? Here are a few ideas…
And finally...

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Explores Object Pascal, which is highly relevant in industry
Teaches the fundamentals of programming, which is a core skill for developers
Taught by Huw Collingbourne, who is recognized for their work in Object Pascal
Covers the principles and practice of object orientation, which is a core concept in modern programming
Provides a step-by-step approach, which is ideal for beginners
Uses both Delphi and Lazarus, which are widely used industry-standard tools

Save this course

Save Learn To Program with Delphi and Object Pascal to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Learn To Program with Delphi and Object Pascal with these activities:
Organize Course Materials
Maintain a well-organized system for your course notes, assignments, quizzes, and exams to enhance your ability to access and review materials, improving retention and understanding.
Show steps
  • Create a dedicated folder or notebook for the course.
  • File and categorize notes, assignments, and other materials logically.
  • Regularly review and summarize your notes to reinforce learning.
  • Use different colors or highlighters to emphasize important concepts.
Review the Little Book Of Pascal
Review the core concepts of Object Pascal, including variables, constants, operators, and data types, to strengthen your foundation for the course.
View The Book of Ruby on Amazon
Show steps
  • Download the Little Book Of Pascal eBook supplied with the course.
  • Read through the book, taking notes on key concepts.
  • Complete the exercises at the end of each chapter to test your understanding.
Follow Online Pascal Tutorials
Supplement your course learning by exploring online tutorials and resources that cover specific Pascal concepts or programming techniques to gain a deeper understanding of the language.
Show steps
  • Search for online tutorials or video courses on Pascal programming.
  • Choose tutorials that align with the topics you're learning in the course.
  • Follow the tutorials step-by-step and complete the exercises provided.
  • Experiment with the code and try implementing your own variations.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Solve Pascal Programming Exercises
Practice writing and debugging Pascal code by working through a series of exercises to reinforce your understanding of the language's syntax and semantics.
Show steps
  • Find online resources or textbooks with Pascal programming exercises.
  • Choose exercises that cover topics you're learning in the course.
  • Write code to solve the exercises and test it thoroughly.
  • Compare your solutions with provided solutions or seek help from online forums.
Participate in Pascal Study Groups
Engage with fellow learners by participating in study groups or online forums to discuss Pascal concepts, share knowledge, and collaborate on projects to enhance your understanding and retention.
Show steps
  • Join online forums or social groups dedicated to Pascal programming.
  • Attend virtual or in-person study sessions with other students.
  • Discuss course materials, ask questions, and share your insights.
  • Collaborate on small projects or exercises to apply your knowledge.
Build a Simple Pascal Program
Create a basic Pascal program that demonstrates your understanding of the language's features, such as data types, operators, and control flow, to apply your knowledge in a practical setting.
Show steps
  • Choose a simple problem or task that you can solve with Pascal.
  • Design the program's logic and data structures.
  • Write the Pascal code for your program.
  • Test and debug your program to ensure it works correctly.
  • Share your program with others for feedback.
Develop a Pascal Application
Embark on a project to design and develop a Pascal application that showcases your skills and knowledge in the language, fostering a deeper understanding of its capabilities and real-world applications.
Show steps
  • Define the purpose and scope of your application.
  • Design the application's architecture and user interface.
  • Write the Pascal code for your application.
  • Test and debug your application thoroughly.
  • Deploy your application and gather feedback from users.

Career center

Learners who complete Learn To Program with Delphi and Object Pascal will develop knowledge and skills that may be useful to these careers:
Software Developer
A Software Developer is responsible for designing, developing, testing, and maintaining software applications. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of software development projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Software Developer.
Web Developer
A Web Developer is responsible for designing, developing, and maintaining websites. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of web development projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Web Developer.
Database Administrator
A Database Administrator is responsible for managing and maintaining databases. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of database administration tasks. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Database Administrator.
Systems Analyst
A Systems Analyst is responsible for analyzing and designing computer systems. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of systems analysis and design projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Systems Analyst.
Computer Programmer
A Computer Programmer is responsible for writing and maintaining computer programs. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of computer programming projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Computer Programmer.
Information Technology Specialist
An Information Technology Specialist is responsible for providing technical support and assistance to users of computer systems. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of information technology support tasks. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Information Technology Specialist.
Computer Systems Analyst
A Computer Systems Analyst is responsible for analyzing and designing computer systems. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of computer systems analysis and design projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Computer Systems Analyst.
Software Engineer
A Software Engineer is responsible for designing, developing, and maintaining software applications. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of software engineering projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Software Engineer.
Web Designer
A Web Designer is responsible for designing and developing websites. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of web design projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Web Designer.
Database Developer
A Database Developer is responsible for designing and developing databases. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of database development projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Database Developer.
Systems Administrator
A Systems Administrator is responsible for managing and maintaining computer systems. This course can help you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of systems administration tasks. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming, all of which are essential skills for any Systems Administrator.
Computer Network Architect
A Computer Network Architect is responsible for designing and implementing computer networks. This course may be useful in helping you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of computer network architecture projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming.
Computer Hardware Engineer
A Computer Hardware Engineer is responsible for designing and developing computer hardware. This course may be useful in helping you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of computer hardware engineering projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming.
Computer Science Teacher
A Computer Science Teacher is responsible for teaching computer science to students. This course may be useful in helping you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of computer science education projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming.
Information Security Analyst
An Information Security Analyst is responsible for protecting computer systems and data from unauthorized access. This course may be useful in helping you build a foundation in Object Pascal, which is a powerful and versatile programming language used in a variety of information security analysis projects. The course covers topics such as data types, operators, loops, arrays, and object-oriented programming.

Reading list

We've selected six books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Learn To Program with Delphi and Object Pascal.
Offers an in-depth exploration of the Delphi programming environment, delving into advanced topics such as memory management, threading, and database connectivity. It provides valuable insights into the inner workings of Delphi, enabling readers to develop more efficient and robust applications.
The Programming with Lazarus book offers a comprehensive guide to the Lazarus programming environment, providing detailed explanations of its features and capabilities. It valuable resource for developers seeking to utilize Lazarus for cross-platform application development, enabling them to effectively harness its tools and techniques.
The Little Book of Pascal serves as a concise and accessible introduction to the Pascal programming language, providing a solid foundation for understanding its syntax, semantics, and best practices. It valuable resource for beginners seeking to develop a strong foundation in Pascal and enhance their programming skills.
A quick reference guide to Delphi that covers the most important topics.
The Programming Delphi book provides a comprehensive introduction to Delphi programming, guiding readers through the fundamentals of the language and the Delphi development environment. It is particularly suitable for beginners seeking to develop a solid foundation in Delphi programming.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to Learn To Program with Delphi and Object Pascal.
Programming Java for Beginners - The Ultimate Java...
Build a Guessing Game Application using Java
Learn C# Programming (In Ten Easy Steps)
Intermediate Object-Oriented Programming for Unity Games
Object Oriented Development using C#
Intermediate Object-Oriented Programming for Unreal Games
Java Object-Oriented Programming: AP Computer Science B
Windows Command Line (MS-DOS), Batch Scripting &...
Introduction To Swift Programming
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser