John Kouraklis
London, UK
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the books product page, located at www.apress.com/9781484261118 . For more detailed information, please visit http://www.apress.com/source-code .
ISBN 978-1-4842-6111-8 e-ISBN 978-1-4842-6112-5
https://doi.org/10.1007/978-1-4842-6112-5
John Kouraklis 2020
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Distributed to the book trade worldwide by Apress Media, LLC, 1 New York Plaza, New York, NY 10004, U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
Introduction
Delphi is a modern general-purpose programming language which enhances and supersedes Object Pascal. It is in the market for more than two decades now, and it is used in a wide range of applications. The language is maintained by Embarcadero and is backed by a large community of developers.
The language is versatile, it supports different programming paradigms, and it exhibits quick learning curve. It is easy to grasp the main and fundamental concepts and start coding straightaway. Naturally, as in every language, there is complexity down the line especially when advanced libraries are utilized.
This book offers a guide to the fundamentals. It takes people with no knowledge of the language all the way to what they need to know to start their journey in Delphi. By the end of this book, you will have enough knowledge to be able to read articles about Delphi and understand code of intermediate complexity. In short, this book offers a fast-track induction course to the language.
Who This Book Is For
The typical reader of this book is the newcomer to Delphi with basic knowledge of computer programming. The book offers all the necessary knowledge to get you started with Delphi and provides a wide range of references to allow you expand your knowledge.
After reading this book, you will be able to
Discuss the fundamental elements of the language
Appreciate the different programming paradigms that can be used in Delphi
Write code to demonstrate the basic concepts of the language
Although the newcomer is in the center of this book, the experienced developer will benefit every time they are unsure or need a refresher on topics around the fundamentals of the language.
The Development Environment
The code in this book is written using the following environment:
I use the Professional edition, but there is nothing I do that exploits any features specific to this edition. The code can be tested using even the free Community Edition of Delphi. In fact, most of the code can be executed in other editions of Object Pascal.
There are some topics that utilize features found in specific versions of Delphi. Whenever this happens, I clearly flag the topics.
The Books Structure
The book has five chapters. It starts with basic syntactical elements of the language and gradually introduces how core concepts of modern programming are managed in Delphi. Each chapter is independent to previous chapters, which means you can start reading the most suitable subject to your situation.
Chapter : Delphi Pascal
This chapter looks at Delphi as a programming language. It discusses the syntax and structure of the code, and it introduces the basic development workflow Delphi developers follow.
Chapter : Basics
The second chapter provides the fundamental knowledge a newcomer needs to get an understanding of how basic concepts in programming work in Delphi. Variables, data types, and generics are introduced.
Chapter : Looping, Conditional and Jump Statements
Managing the execution flow of code in Delphi is the topic of this chapter. Common structures like loops, conditional statements, and code jumps are covered to provide to the reader different ways to control logic in code.
Chapter : Procedures and Functions
In this chapter, we move to modular programming. We visit procedures and functions and investigate the way they are implemented and used in Delphi.
Chapter : Object-Oriented Programming (OOP)
OOP is one of the most fundamental and widespread paradigms in modern software development. In this chapter, we look at how OOP is done in Delphi and expand the discussion to cover interfaces, another core concept of contemporary programming.
Code Files
This book includes source code files that can be accessed via the Download Source Code link located at www.apress.com/9781484261118 . The projects are named after the number of the chapter ( ChapterXX ) they refer to. There is also a dedicated project group which loads all the projects for all chapters. You can find it under the name DelphiQuickReference.groupproj .