100% found this document useful (1 vote)
18 views

Delphi Quick Syntax Reference: A Pocket Guide to the Delphi and Object Pascal Language 1st Edition John Kouraklis - Download the ebook and explore the most detailed content

The document promotes various eBooks available for instant download on ebookmeta.com, including titles like 'Delphi Quick Syntax Reference' by John Kouraklis and other programming guides. It provides links to each eBook and mentions the availability of different formats such as PDF, EPUB, and MOBI. Additionally, it includes details about the author and technical reviewer of the featured Delphi book, emphasizing its utility for newcomers to the language.

Uploaded by

oikwanserhey
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
18 views

Delphi Quick Syntax Reference: A Pocket Guide to the Delphi and Object Pascal Language 1st Edition John Kouraklis - Download the ebook and explore the most detailed content

The document promotes various eBooks available for instant download on ebookmeta.com, including titles like 'Delphi Quick Syntax Reference' by John Kouraklis and other programming guides. It provides links to each eBook and mentions the availability of different formats such as PDF, EPUB, and MOBI. Additionally, it includes details about the author and technical reviewer of the featured Delphi book, emphasizing its utility for newcomers to the language.

Uploaded by

oikwanserhey
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 77

Read Anytime Anywhere Easy Ebook Downloads at ebookmeta.

com

Delphi Quick Syntax Reference: A Pocket Guide to


the Delphi and Object Pascal Language 1st Edition
John Kouraklis

https://ebookmeta.com/product/delphi-quick-syntax-reference-
a-pocket-guide-to-the-delphi-and-object-pascal-language-1st-
edition-john-kouraklis/

OR CLICK HERE

DOWLOAD EBOOK

Visit and Get More Ebook Downloads Instantly at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

C# 10 Quick Syntax Reference: A Pocket Guide to the


Language, APIs, and Library Mikael Olsson

https://ebookmeta.com/product/c-10-quick-syntax-reference-a-pocket-
guide-to-the-language-apis-and-library-mikael-olsson/

ebookmeta.com

R Quick Syntax Reference, 2nd Edition: A Pocket Guide to


the Language, APIs and Library Margot Tollefson

https://ebookmeta.com/product/r-quick-syntax-reference-2nd-edition-a-
pocket-guide-to-the-language-apis-and-library-margot-tollefson/

ebookmeta.com

CSS3 Quick Syntax Reference, 2nd Edition: A Pocket Guide


to the Cascading Style Sheets Language Mikael Olsson

https://ebookmeta.com/product/css3-quick-syntax-reference-2nd-edition-
a-pocket-guide-to-the-cascading-style-sheets-language-mikael-olsson/

ebookmeta.com

Power of Love 1st Edition Piper Cook

https://ebookmeta.com/product/power-of-love-1st-edition-piper-cook/

ebookmeta.com
Stealing Atlanta Cary Allen Stone

https://ebookmeta.com/product/stealing-atlanta-cary-allen-stone/

ebookmeta.com

Tempest Tide Avalar Explored 03 1st Edition Deacon Frost

https://ebookmeta.com/product/tempest-tide-avalar-explored-03-1st-
edition-deacon-frost-2/

ebookmeta.com

English Fiction of the Romantic Period 1789 1830 1st


Edition Gary Kelly

https://ebookmeta.com/product/english-fiction-of-the-romantic-
period-1789-1830-1st-edition-gary-kelly/

ebookmeta.com

Scientific American Mind Scientific American

https://ebookmeta.com/product/scientific-american-mind-scientific-
american/

ebookmeta.com

Rick Steves Berlin 4th Edition Rick Steves

https://ebookmeta.com/product/rick-steves-berlin-4th-edition-rick-
steves/

ebookmeta.com
Occupational Safety and Health in the Emergency Services
5th Edition James Angle

https://ebookmeta.com/product/occupational-safety-and-health-in-the-
emergency-services-5th-edition-james-angle/

ebookmeta.com
Delphi
Quick Syntax
Reference
A Pocket Guide to the Delphi and
Object Pascal Language

John Kouraklis

www.allitebooks.com
Delphi Quick Syntax
Reference
A Pocket Guide to the Delphi
and Object Pascal Language

John Kouraklis

www.allitebooks.com
Delphi Quick Syntax Reference: A Pocket Guide to the Delphi and Object
Pascal Language
John Kouraklis
London, UK

ISBN-13 (pbk): 978-1-4842-6111-8 ISBN-13 (electronic): 978-1-4842-6112-5


https://doi.org/10.1007/978-1-4842-6112-5

Copyright © 2020 by John Kouraklis


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.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark
symbol with every occurrence of a trademarked name, logo, or image we use the names, logos,
and images only in an editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of opinion as to whether or not
they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Steve Anglin
Development Editor: Matthew Moodie
Coordinating Editor: Mark Powers
Cover designed by eStudioCalamar
Cover image by Victor Malyushev on Unsplash (www.unsplash.com)
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.
For information on translations, please e-mail [email protected]; for reprint, paperback, or
audio rights, please email [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our Print
and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available
to readers on GitHub via the book’s product page, located at www.apress.com/9781484261118.
For more detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper

www.allitebooks.com
Table of Contents
About the Author��������������������������������������������������������������������������������vii
About the Technical Reviewer�������������������������������������������������������������ix
Introduction�����������������������������������������������������������������������������������������xi

Chapter 1: Delphi Pascal�����������������������������������������������������������������������1


Delphi As a Programming Language���������������������������������������������������������������������1
Syntax��������������������������������������������������������������������������������������������������������������1
Programming Paradigms���������������������������������������������������������������������������������2
Compilation to Native Code�����������������������������������������������������������������������������3
Visual Applications������������������������������������������������������������������������������������������3
One Code Base for Multiple Platforms�������������������������������������������������������������3
Anatomy of a Delphi Program�������������������������������������������������������������������������������4
Project Files�����������������������������������������������������������������������������������������������������4
Units����������������������������������������������������������������������������������������������������������������5
Forms and Frames������������������������������������������������������������������������������������������6
Delphi As Integrated Development Environment (IDE)������������������������������������������7
A Simple Application (Console)�����������������������������������������������������������������������������9
A Simple Application (Graphical)�������������������������������������������������������������������������11
Alternative IDEs���������������������������������������������������������������������������������������������������14
Delphi Style Guide�����������������������������������������������������������������������������������������������15
Summary������������������������������������������������������������������������������������������������������������15
References����������������������������������������������������������������������������������������������������������15

iii

www.allitebooks.com
Table of Contents

Chapter 2: Basics�������������������������������������������������������������������������������17
Variables�������������������������������������������������������������������������������������������������������������17
Data Types�����������������������������������������������������������������������������������������������������������20
Integer�����������������������������������������������������������������������������������������������������������20
Char���������������������������������������������������������������������������������������������������������������21
Boolean����������������������������������������������������������������������������������������������������������22
Enumerated Types�����������������������������������������������������������������������������������������22
Subrange�������������������������������������������������������������������������������������������������������23
Real���������������������������������������������������������������������������������������������������������������23
Strings�����������������������������������������������������������������������������������������������������������25
Sets���������������������������������������������������������������������������������������������������������������27
Arrays������������������������������������������������������������������������������������������������������������28
Records���������������������������������������������������������������������������������������������������������31
Pointers���������������������������������������������������������������������������������������������������������35
Variant�����������������������������������������������������������������������������������������������������������36
Generics��������������������������������������������������������������������������������������������������������37
Constants������������������������������������������������������������������������������������������������������������40
Comments�����������������������������������������������������������������������������������������������������������41
Summary������������������������������������������������������������������������������������������������������������42
References����������������������������������������������������������������������������������������������������������42

Chapter 3: Looping, Conditional and Jump Statements���������������������43


Loops������������������������������������������������������������������������������������������������������������������43
While Statement��������������������������������������������������������������������������������������������43
Repeat Statement������������������������������������������������������������������������������������������45
For Statement������������������������������������������������������������������������������������������������46
Conditional Statements���������������������������������������������������������������������������������������48
If Statement���������������������������������������������������������������������������������������������������48
Case Statement���������������������������������������������������������������������������������������������50

iv

www.allitebooks.com
Table of Contents

Jump Statements������������������������������������������������������������������������������������������������51
Exit Statement�����������������������������������������������������������������������������������������������51
Break Statement��������������������������������������������������������������������������������������������52
Continue Statement���������������������������������������������������������������������������������������52
Goto Statement����������������������������������������������������������������������������������������������53
Summary������������������������������������������������������������������������������������������������������������54

Chapter 4: Procedures and Functions������������������������������������������������55


Declaration����������������������������������������������������������������������������������������������������������55
Parameters���������������������������������������������������������������������������������������������������������57
The Nature of Parameters�����������������������������������������������������������������������������59
Default Values of Parameters������������������������������������������������������������������������62
Interrupting the Normal Execution����������������������������������������������������������������������64
Nested Methods��������������������������������������������������������������������������������������������������64
Typed Methods����������������������������������������������������������������������������������������������������65
Anonymous Methods������������������������������������������������������������������������������������������68
Method Overloading��������������������������������������������������������������������������������������������71
Summary������������������������������������������������������������������������������������������������������������72
References����������������������������������������������������������������������������������������������������������72

Chapter 5: Object-Oriented Programming (OOP)��������������������������������73


Declaration����������������������������������������������������������������������������������������������������������73
Object State (Fields)��������������������������������������������������������������������������������������������75
Object Functionality (Methods)���������������������������������������������������������������������������78
Object State (Properties)�������������������������������������������������������������������������������������82
Class Members and Methods������������������������������������������������������������������������������86
Inheritance����������������������������������������������������������������������������������������������������������87
Interfaces������������������������������������������������������������������������������������������������������������93

v
Table of Contents

Cross-Platform Memory Management����������������������������������������������������������������97


Summary����������������������������������������������������������������������������������������������������������101
References��������������������������������������������������������������������������������������������������������102

Index�������������������������������������������������������������������������������������������������103

vi
About the Author
John Kouraklis started exploring computers when he was 16 and since
then has followed all the way from Turbo Pascal to the latest Delphi
versions as a hobby initially and as a profession for most of his adult life.
He has developed a wide range of applications, from financial software
to reverse engineering tools, including an application for professional
gamblers.
He is part of the Delphi community and participates in online
communities, forums, and many other events. For example, he is active
on Delphi-PRAXiS, which is perhaps the biggest English-speaking online
forum about Delphi. John also has a personal website where he posts
articles regularly. Lastly, he has written two more books about Delphi
published by Apress.

vii
About the Technical Reviewer
Dr. Holger Flick studied computer science at the Technical University
of Dortmund and received his doctorate from the Faculty of Mechanical
Engineering at the Ruhr-University Bochum. He has been programming
with Delphi since 1996 and has always been active in the community.
During and after his studies, he worked as a freelancer on numerous
projects for Borland and was able to exchange ideas directly with many
Delphi experts from Scotts Valley, CA. Mainly, he tested Delphi for the
QA department, but also programmed database applications and web
applications for the Borland Developer Network. Holger has also presented
at conferences and seminars on various Delphi topics. His commitment
and extensive knowledge of Delphi programming, gained through years of
theoretical and practical work in the area of object-oriented programming
with Delphi and other programming languages (e.g., C#, Objective-C), led
to his appointment as the Embarcadero Delphi MVP in 2016. From 2013 to
2018, Dr. Holger Flick was responsible for the entire software and hardware
architecture of a medium-sized business in Witten, Germany.
Among other things, he developed company-specific software
solutions with Delphi. Since 2017, he presents products and solutions
of TMS software as Chief Evangelist in the form of numerous technical
articles, bilingual video tutorials, and leads through seminars. In 2019,
he founded FlixEngineering LLC in the United States and is available for
Delphi contracting of any kind. The next year, he self-published several
books himself for web and desktop software development with Delphi.

ix
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.

xi
Introduction

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:

• Embarcadero Delphi 10 Sydney (10.4)

• Microsoft Windows 10 Professional

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 Book’s 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.

xii
Introduction

C
 hapter 1: 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.

C
 hapter 2: 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.

C
 hapter 3: 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.

C
 hapter 4: 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.

C
 hapter 5: 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.

xiii
Introduction

C
 ode 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.

xiv
CHAPTER 1

Delphi Pascal
Delphi Pascal or, simply, Delphi is the most popular version of Object Pascal
which, in turn, is an extension of the classic Pascal programming language
(Cantu, 2016). This chapter introduces the basic concepts of the language.

Delphi As a Programming Language


Delphi is a general-purpose programming language. As a Pascal
descendent, it draws its strong typing and syntactical characteristics from
the original Pascal language developed by Niklaus Wirth in the early 1970s,
but it, loosely, relates to the ISO standard Pascal (i.e., it is not a superset).
Over the past decades, Delphi has evolved, and now it has features that
makes it a modern programming language capable of building professional
software in multiple platforms.

S
 yntax
If you look at Delphi source code, you will notice that it is dominated by
words rather than symbols. Code appears inside a begin...end block
rather than inside symbols like curly brackets ({..}) as in other languages.
Typically, code flows from top to bottom and from left to right. This
implies that variables, objects, constants, and other elements need
first to be declared before they are used (with the exception of forward
declaration of classes).

© John Kouraklis 2020 1


J. Kouraklis, Delphi Quick Syntax Reference, https://doi.org/10.1007/978-1-4842-6112-5_1
Chapter 1 Delphi Pascal

Delphi is case insensitive, meaning that coding elements like variables,


objects, methods, and the like can be declared in small or capital letters or
in a combination of both. For example, the following declarations are all
valid in Delphi: delphiBook, delphi_Book, DelphiBook, DELPHIBOOK,
delphiBOOK. There are naming rules which prohibit the use of specific
characters (e.g., an identifier cannot start with a number, etc.), but the
limitations are very few, and, practically, when you code in Delphi, it is not
common to come across them.
A notable difference with other languages is the operator to assign
values to variables. In Delphi, a colon followed by the equal sign (:=) is
used for this purpose, and the simple equal sign (=) is used to test equality
in expressions.
Lastly, a convention that survived from the classic Pascal is the way the
end of code line is declared in Delphi. Most of the lines of code end with a
semicolon (;) with the exception of keywords (e.g., begin...end, if...then,
while...do, etc.) and the last keyword in a code file. Every code file ends
with the keyword end followed by a period (end.)

Programming Paradigms
Delphi is a fully developed object-oriented programming (OOP) language
but does not force any specific development paradigm. You are free to
use the OOP approach, but if, for some reasons, you prefer to use pure
procedural programming, Delphi can fully support you. In fact, a huge part
of the native libraries in Delphi come as procedures rather than embedded
in objects and classes. This stands for Windows API calls, but, as the
language is moving to cross-platform code, more libraries come in classes
and records.

2
Chapter 1 Delphi Pascal

Compilation to Native Code


The final artifact of compilation of Delphi code is binary files with native
code. In computing, this means that the final files represent machine code
instead of an intermediate form like the one you find in virtual machine
bytecode other languages produce. As a result, the executables run directly
on top of the operating system without any translation layers between the
executables and the underlying APIs of the operating systems.

Visual Applications
Delphi provides two out-of-the-box frameworks to support the
development of visual applications: the Visual Component Library (VCL)
and, starting from Delphi XE2, the FireMonkey (FMX) framework. VCL
is used for Windows applications only, and FMX provides cross-platform
components to build graphical user interfaces. Apart from VCL and FMX,
there are third-party frameworks and libraries available to enrich the
development of visual applications.

One Code Base for Multiple Platforms


One of the most distinguished characteristics of modern Delphi is the
ability to produce binaries for multiple platforms from the same code base.
At the time of writing, there are very few development tools in the market
that truly support this. This means that, as a developer, you write code
without any considerations as to which platform it will compile to, and
Delphi takes the task to produce the appropriate executables or libraries
for the platform of your choice. Currently, Delphi supports the following
platforms: Windows 32-bit, Windows 64-bit, macOS 32-bit, macOS 64-bit,
Android 32-bit, Android 64-bit, iOS, iOS 32-bit, iOS 64-bit, iOS Simulator,

3
Chapter 1 Delphi Pascal

and Linux 64-bit. It is worth mentioning that although you can create
applications for all the preceding platforms, the development is done on
Windows only; that is, the compilers are Windows programs themselves.

Note Although you can write cross-platform code without considering


the details of the target platform, it is almost inevitable that your code,
at some stage, will need to take advantage of the specificities of the
target operating system. For that matter, Delphi allows you to fine-tune
your code base using compiler directives and attributes.

Anatomy of a Delphi Program


A typical Delphi program can generate a number of different files
depending on the nature of the program and the target platform.

Project Files
A program in Delphi has one source code file saved under the name of the
application and with the .dpr extension. The code starts with the program
keyword followed by the name of the application, and it has one main block
of code enclosed in the begin..end keywords. The last end keyword is
followed by a period (end.), and this signifies the end of the code file. Any text
that appears after this generates a warning, but it is ignored by the compiler.
Delphi also generates a file with the .dproj extension. This file holds
vital information about the cross-platform configurations, and it can also
be used when the compilation of code is streamlined to MSBUILD.
There are a number of other support files with different extensions
(e.g., .local, .deployproj) you may find, but they are not vital for the
correct compilation of a Delphi program, or the compiler can regenerate
them automatically.

4
Chapter 1 Delphi Pascal

Units
You can, very easily, create one big file and store all your code in it (with
the exception of visual elements like forms and frames). Delphi will not
complain and will compile your code correctly. However, this does not
sound something that scales up easily when you write complex software.
Instead, common practice suggests to organize your code in smaller
separate files or modules as they are known in software engineering.
Delphi is a modular language and provides support to modules via
unit files. In Pascal world, the term unit is used instead of module. The
term module still exists in Delphi, and it refers to a special component
(TDataModule) which sits in its own separate unit file. A unit is a separate
code file, it has the .pas extension, and it is linked back to the project
and is compiled to a binary file with the extension .dcu. DCUs are more
important than the source code files because the compiler is able to use
a .dcu file without the need to locate and access the corresponding .pas
file. The downside is that DCU files are tightly linked to the version of the
compiler that was used to create them. There were some exceptions in the
past, but this is the general rule.
The following snippet shows the minimum elements you can find in
a unit file (which, basically, does nothing). There are two distinct parts—
interface and implementation. The interface section is the part of the
unit that is visible to other units. For example, if you declare a variable in
this section, it will be accessible to any other units that refer to this unit. On
the other hand, any declarations made in the implementation section are
only available in this unit and not outside it. When it comes to OOP, classes
are typically declared in the interface section, and any method code
should appear in the implementation section in the same unit. Of course,
you can have the declaration and implementation of a class solely in the
implementation section, but it will be accessible only within the unit.

5
Chapter 1 Delphi Pascal

unit QuickReference;

interface

// Declarations come here

implementation

// Declarations and Actual code come here

end.

This unit is named QuickReference, and the file name is and should
be under the same name (QuickReference.pas). Delphi allows the use of
dot notation in units which provides the ability to generate namespaces. As
a result, you can save the unit under the name Quick.Reference.Delphi.
pas. When you want to access the unit, you simply declare it using the
keyword uses as follows:

uses
  Quick.Reference.Delphi;

The uses clause can appear either in the interface or the


implementation part of a unit.

Forms and Frames


A form in Delphi is a representation of the typical window you see in visual
applications. If you want to add a label or an edit field in the window, you
add them in a form, and, when the code is executed, you see a window
with the components.
Delphi creates two files for each form: a typical .pas file which
contains all the declarations and any custom code you want to add to alter
the behavior of the form and a .dfm (in VCL) or .fmx (in FireMonkey) file
which holds information about the components in a form. A valid form
needs both files.

6
Chapter 1 Delphi Pascal

Frames are very similar to forms with the difference that they do not
represent stand-alone windows and they do not have system menus and
icons. A frame can be embedded in forms or in other frames to build more
complex and reusable user interfaces. In terms of files, frames use the
same file structure as forms.

 elphi As Integrated Development


D
Environment (IDE)
It is very possible to use a simple text editor to write Delphi code and
then compile it using the compiler. This is the typical workflow of writing
software in other programming languages.
However, the preceding approach is not scalable or even workable
for the Delphi developer. Perhaps if you only write console applications,
this may work, but the rule is that you write Delphi code in the integrated
development environment that comes with the compiler provided by
Embarcadero, the company behind Delphi. The IDE is branded as RAD
Studio or Delphi IDE. This is a Windows application with a fully developed
text editor (Figure 1-1), form designer (Figure 1-2), debugger, and project
management features. The figures show the Delphi 10.4 IDE. The compiler
and the form designer are very tightly coupled to the IDE, and, in practical
terms, development in Delphi means writing code in RAD Studio.

7
Chapter 1 Delphi Pascal

Figure 1-1. The Code View of Delphi IDE (Delphi 10.4 Sydney)

Figure 1-2. The Form Designer in RAD Studio (Delphi 10.4 Sydney)

The Delphi IDE is one of the most feature-rich development


environments that exist in the market. If you would like to learn more,
please read the official documentation for the latest release of the IDE
(Embarcadero, n.d.) or download and install either the community edition
or the trial version from the product’s home page (Embarcadero, 2020).

8
Chapter 1 Delphi Pascal

A Simple Application (Console)


The simplest application you can create is a console application. This
type of application does not have any graphical environment. It provides
a text-only interface (Windows Console, macOS Terminal, etc.), and the
interaction with the user is done via the keyboard and the display screen.
We are going to get started in Delphi by creating a console application.
1. Open Delphi IDE.
2. Select the File ➤ New ➤ Console Application –
Delphi menu item.
This will create a simple console application with
the minimum code to support the development of a
console application.
3. Save the project under the name Cheers.
4. We just want to print a simple message in the
console. Go to the Code Editor by clicking on the tab
at the bottom of the main part of the screen and add
the following lines (in bold):

program Cheers;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

begin
  try
    { TODO -oUser -cConsole Main : Insert code here }
    Writeln('Hey Delphi, Cheers!');
    Writeln('Press Enter');
    Readln;

9
Chapter 1 Delphi Pascal

  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

5. Then either go to Run ➤ Run menu item, press F9


or use the relevant button in the toolbar. This will
compile and execute the code, and you will be able
to see the output in a console window (Figure 1-3).
Press Enter to close it and return to the IDE.

Figure 1-3. Simple Output to Console

Debugging is done inside the IDE as well. You can set a breakpoint at a
code line by clicking the gutter area in the text editor. When a breakpoint is
set, a red circle appears as shown in Figure 1-4. This area is the gutter area
of the editor.

10
Chapter 1 Delphi Pascal

Figure 1-4. Breakpoints in the Delphi IDE

Run again the project by pressing F9. This time the execution will stop
at the line with the breakpoint, and you will be able to step through the
code gradually by using the debugger buttons in the toolbar.

A Simple Application (Graphical)


In the previous section, we created a simple console application. This time
we will create a graphical application to demonstrate how the IDE is used
at a very basic level.

1. Select File ➤ New ➤ Windows VCL Application –


Delphi or Multi-Device Application – Delphi from
the main menu.

The VCL, obviously, uses the VCL framework, and the


Multi-Device Application uses FireMonkey (FMX).

11
Chapter 1 Delphi Pascal

2. If you select Multi-Device Application, you will be


offered a list of different types of FMX applications
(templates). Just select Blank Application.

3. Now the IDE will open the form designer.


4. Use the Palette panel (usually located on the
right-hand side of the screen), find the TButton
component (Figure 1-5), and drag and drop it to the
form. Alternatively, you can click once the TButton
and then click again somewhere in the form. This
will add a button (Figure 1-6).

Figure 1-5. Selecting TButton from the Palette

5. Double-click the button. The designer will change to


the code editor and will add some code. Then, add
the following code:

procedure TForm1.Button1Click(Sender: TObject);


begin
  ShowMessage('Hey Delphi, Cheers!');
end;

12
Chapter 1 Delphi Pascal

Figure 1-6. Form Designer in Delphi IDE (Delphi 10.4 Sydney)

6. Run the application and click the button. You are


greeted with a message (Figure 1-7).

The preceding two simple applications demonstrate the most basic


workflows in Delphi and present the basic editors (code, form) of the IDE.

13
Chapter 1 Delphi Pascal

Figure 1-7. VCL Application in Delphi IDE (Delphi 10.4 Sydney)

Alternative IDEs
As mentioned earlier, Delphi development is done in Delphi IDE, which
comes together with the compilers. The only other alternative to write pure
Delphi code is to use Visual Studio Code with the OmniPascal extension
(OmniPascal, 2020). OmniPascal adds to Visual Studio Code the capability
to understand Delphi syntax and then to compile, debug, and run Delphi
programs. The only downside is that it does not offer a form designer,
which means that the Delphi IDE remains the only way to develop
graphical applications in Delphi.
If we open the scope of the IDE and look at the domain of Object
Pascal more broadly, there is another IDE worth mentioning. The Free
Pascal community offers Lazarus (Lazarus, 2020) which is a cross-platform
open source IDE. Lazarus is highly compatible with Delphi, but it is
primarily made to support Free Pascal—another flavor of Object Pascal.

14
Chapter 1 Delphi Pascal

Delphi Style Guide


Delphi allows coders to use any naming conventions (with some
exceptions as mentioned earlier) they feel work best for them and make
their code readable especially when teams of developers are involved.
As it happens in every programming language, over the years, specific
approaches to naming and other syntactical elements have emerged, and
they are now commonly used among Delphi developers. For a complete
guide, check this post (Calvert, n.d.). There are also some commonly
found approaches to naming variables which are summarized in this piece
(Riley, 2019).

S
 ummary
In this chapter, we started with a very basic introduction of Delphi as
a programming language. Then, we touched upon RAD Studio, the
integrated environment that is, almost exclusively, used to develop Delphi
software. In the next chapter, we review the basic elements of the language.

R
 eferences
Calvert, C., n.d.. Object Pascal Style Guide. [Online] Available at: http://
edn.embarcadero.com/article/10280#2.0 [Accessed 27 04 2020].
Cantu, M., 2016. Object Pascal Handbook. s.l.:s.n.
Embarcadero, 2020. RAD Studio Product Page. [Online] Available at:
www.embarcadero.com/products/rad-studio [Accessed 08 04 2020].
Embarcadero, n.d. RAD Studio Rio. [Online] Available at: http://
docwiki.embarcadero.com/RADStudio/Rio/en/Main_Page [Accessed 08
04 2020].

15
Chapter 1 Delphi Pascal

Lazarus, 2020. Lazarus. [Online] Available at: www.lazarus-ide.org/


[Accessed 08 04 2020].
OmniPascal, 2020. OmniPascal. [Online] Available at: www.
omnipascal.com/ [Accessed 08 04 2020].
Riley, M., 2019. What is the “A” prefix I see used on parameters?.
[Online] Available at: https://capecodgunny.blogspot.com/2019/03/
delphi-tip-of-day-what-is-a-prefix-i.html [Accessed 27 04 2020].

16
CHAPTER 2

Basics
V
 ariables
Variables, a term borrowed from mathematics, is what we use in software
development to store data that change in the course of a program. It
is, practically, hard to write code without using variables. Technically
speaking, variables represent memory addresses, and they have two
elements: an identifier and a data type.
The identifier is a convenient name that is used to access the value
of the variable, and the data type defines what sort of data the variable
holds. Delphi is a strongly and statically typed language. Strongly typed
means that the developer defines the (data) type of the variable, and the
variable cannot hold any other data type than the one defined; statically
typed means that the data type is imposed at compile time rather than at
runtime.
As an example, consider a variable that holds the age of a person.
In Delphi, we define a variable using the keyword var followed by the
identifier (name), a colon, and the data type. Traditionally, variables in
Delphi are declared before the main block of a program or a method. Of
course, all the conventions for naming identifiers and code lines apply
(naming conventions, capitalization, and the use of semicolon at the end
of the code line).

© John Kouraklis 2020 17


J. Kouraklis, Delphi Quick Syntax Reference, https://doi.org/10.1007/978-1-4842-6112-5_2
Chapter 2 Basics

Building on the example from the previous chapter, we define our new
variable as it is shown in the following code (for simplicity, I have removed
the {..} text and the try...except block code):

program Cheers;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

var
  age: Integer;
begin
  Writeln('Hey Delphi, Cheers!');
  Writeln('Press Enter');
  Readln;
  age:=30;
end.

The age variable is defined outside the begin…end block by declaring


the data type (Integer), and then it is used by assigning the value
30. Variables can be used as part of expressions like in every other
programming language.

...
begin
  Writeln('Hey Delphi, Cheers!');
  Writeln('Press Enter');
  Readln;

18
Chapter 2 Basics

  age:=age + 10;
end.

Starting with Delphi 10.3 Rio, developers are able to declare variables
inside block codes (inline variables) and assign values directly. The code
now becomes as follows:

...
begin
  Writeln('Hey Delphi, Cheers!');
  Writeln('Press Enter');
  Readln;
  var age:Integer :=30;
end.

The age variable is valid in the specific block of code (begin...end).


In most cases, the compiler is able to infer the type of the variable.
Therefore, the code can be simplified even further, although if you are
making your first steps in Delphi, you may find useful to explicitly declare
the type of the variable as above. The declaration of an inline variable
which allows the compiler to work out the type looks like this:

  var age:=30;

A concept that comes together with variables (and constants) is the


idea of variable scope. This means that variables are not valid and, thus,
cannot be used anywhere in a code base. Instead, there are boundaries.
Typically, in Delphi, the scope is defined by the begin..end block
closest to the declaration of the variable. In all the examples we have
seen so far, we only have the main block of the console application. The
variables are valid within this scope, but also the scope is global in these
cases because there is only one block code.

19
Chapter 2 Basics

As we add more knowledge around how the language works, we will


see that the scope can be limited within a method (procedure/function), a
loop statement, or a class. In some more advanced code, the scope can be
the main block of a try...except/finally..end statement. Outside the scope, a
variable is not recognizable by the compiler.

D
 ata Types
I nteger
In Delphi, there is a good number of integer types that can be used
depending on how big you expect the number to be, whether you want
to carry the sign or not (signed/unsigned) and the target platform of the
application (Tables 2-1 and 2-2).

Table 2-1. Platform-­Independent Integer Types


Platform-Independent Integer Type

ShortInt (Int8) Signed 8-bit


SmallInt (Int16) Signed 16-bit
Integer (FixedInt) Signed 32-bit
Int64 Signed 64-bit
Byte Unsigned 8-bit
Word Unsigned 16-bit
Cardinal (FixedUInt) Unsigned 32-bit
UInt64 Unsigned 64-bit

20
Chapter 2 Basics

Table 2-2. Platform-Dependent Integer Types


Platform-Dependent Integer Platform Type

NativeInt (Integer) 32-bit (All Platforms) Signed 32-bit


NativeInt (Int64) 64-bit (All Platforms) Signed 64-bit
NativeUInt (Cardinal) 32-bit (All Platforms) Unsigned 32-bit
NativeUInt (UInt64) 64-bit (All Platforms) Unsigned 64-bit
LongInt (Integer) 32-bit (All Platforms) Signed 32-bit
64-bit (Windows)
LongInt (Int64) 64-bit (iOS, Linux) Signed 64-bit
LongWord (Cardinal) 32-bit (All Platforms) Unsigned 32-bit
64-bit (Windows)
LongWord (UInt64) 64-bit (All Platforms) Unsigned 64-bit

Char
The Char data type represents a single character. For historical reasons,
when Unicode characters and strings were added to Delphi, a whole range
of char (and string) types was introduced to accommodate the different
requirements of non-Unicode and Unicode characters (and strings). This
led to some confusion among developers.
Modern Delphi development does not really look at such differences
(unless a very old compiler is used), and the data type char can be safely
used in desktop and mobile applications to handle Unicode characters.

21
Chapter 2 Basics

Boolean
Boolean values represent two states: True and False. As in the case of char
type, there are more than one Boolean types to facilitate communication
with other languages and operating systems, but, again, the vast majority of
code does not use them. True Boolean value translates to 1 and false to 0.

Enumerated Types
Enumerated types need to be defined before used as data types in
variables. They are truly custom data type to fit the needs of the developer.
The values bear no meaning to the compiler and can be used to improve
readability and increase abstraction. Enumerated type can be defined as in
the following examples:

type
  TAnswer = (aYes, aNo);
  TChapter = (cChapter01, cChapter02, cChapter3, cChapter4);

The definition should appear outside the main block..end or an


application or a method. Once they are defined, a variable of TChapter
type is very easily declared:

var
  consent: TAnswer;
  currentChapter: TChapter;

and then we use them as before:

begin
  consent:=aYes;
  currentChapter:=cChapter02;
end.

22
Chapter 2 Basics

S
 ubrange
Subrange is a very handy data type. It provides the ability to declare data
types as a range (Low..High), and it is related to another (predefined) data
type. The code snippet that follows defines a subrange that represents the
adult ages and some chapters from the TChapter enumerated type:

Type
  TMyCoinsAge = 10..High(Byte);
  TMainPart = cChapter02..cChapter04;

Subranges can also resolve expressions:

type
  TExperimentTemp = -10..3 * (20 + 5);

R
 eal
This data type represents a floating-point number (decimal) of different
precision. Table 2-3 presents the available real data types in Delphi.

23
24
Chapter 2

Table 2-3. Floating-Point Data Types


Type Platform Significant Size (Bytes) Notes
Basics

Decimal Digits

Real48 All platforms 11–12 6 Legacy data type


Single All platforms 7–8 4
Real (Double) All platforms 15–16 8
Extended 32-bit Intel (Windows) 10–20 10

Extended 32-bit Intel (all platforms) 10–20 16


Extended 64-bit Intel (Linux) 10–20 16
Extended All other CPUs and platforms 15–16 8
Comp All platforms 10–20 8 Legacy data type
Currency All platforms 10–20 8 64-bit integer with 4
decimal points. Used in
monetary calculations
Chapter 2 Basics

Strings
Strings represent a sequence of characters. The transition to Unicode led
to a number of string data types. Similarly to the case of char, modern
development does not consider the different types, and we just use the
type string (unless an older compiler is used or there are other more
specific requirements).

...
var
  name: string;
begin
  name:='Delphi';
  var surname:='Quick Reference Guide';
end.

As you can see from the preceding code, strings in Delphi are enclosed
in single quotes ('').
If you want to print a single quote, then you have to escape it by using
two single quotes (not double quote mark) as in the following example:

begin
  ...
  Writeln('Delphi''s fantastic world!');
  ...
end.

Delphi carries the same philosophy as the original Pascal language in


regard to the index of the first letter of a string; string starts from 1 rather
than 0; but this is only for Windows. When more platforms were added,
the decision was made to revert to the most common indexing style in the
world of software and assign the value 0 to the first character of a string
(except for macOS which uses the Windows convention). Therefore, if you
want to access the first character of name, on Windows you write this:

25
Chapter 2 Basics

Writeln(name[1]);

but on any other platform, you access it this way:

  Writeln(name[0]);

This approach means that you need to differentiate the code based on
the platform you are compiling. There is another way to go around this.
You can use the function Low to allow the compiler to figure out the correct
starting index:

Writeln(name[low(name)]);

The manipulation of strings (e.g., concatenating, extracting substrings,


finding the position of a substring, etc.) is supported in all platforms by
simple calls to methods. For example, if you want to find the position of a
substring in a given string, the following call will do the job and return 14
on Windows and 13 on all other platforms:

Writeln(Pos('Reference', 'Delphi Quick Reference'));

Although this code works, in the cross-platform world, the use of


standard methods to manipulate strings is not recommended. Instead,
Delphi comes with a new set of methods optimized for speed and platform
compatibility and goes under TStringHelper in System.SysUtils unit.
These methods are accessed using the dot notation (.) on a string.
Therefore, the preceding code now becomes

    Writeln('Delphi Quick Reference'.IndexOf('Reference'));

Due to the fluent approach (dot notation), several methods can be


chained to manipulate strings. For example, check this code snippet:

Writeln('Delphi Quick Reference'


                               .Substring(0,'Delphi'.Length)
                               .ToUpper);

26
Chapter 2 Basics

This code first applies the SubString methods on 'Delphi Quick


Reference' string starting from index 0. It extracts as many characters as
the length of string 'Delphi' using the Length method. Then, it converts
the extracted part to uppercase using ToUpper method and prints out the
word DELPHI.
As mentioned, TStringHelper is the modern approach to string
manipulation, and it should replace the use of older methods as they may
be deprecated in future versions (Embarcadero, 2015).

Sets
Sets are an extremely convenient way to manage groups of elements of the
same data type. A set is defined in relation to an enumerated data type.
Earlier when we discussed enumerated types, we defined TChapter. Now,
we need a set to represent the chapters we have read. We do this with the
following declarations:

type
  TChapter = (cChapter01, cChapter02, cChapter3, cChapter4);
  TChaptersRead = set of TChapter;

var
  progress: TChaptersRead;

begin
  progress:=[cChapter01, cChapter02];
end.

This time we declare TChaptersRead to represent a set of chapters, and


we assign the progress variable to this particular type. Then, populating
progress with chapters is a very simple step.
In fact, the power of sets becomes apparent when we consider
the easiness of manipulating that comes with the use of addition and
subtraction operators.

27
Another Random Document on
Scribd Without Any Related Topics
Malachean Orphan Society, where O'Connell presided, but having
indulged in his potations at a luncheon, he forgot the requirement
for his services at Mrs. Mahony's great rooms in Patrick Street. "I
slept," said he, "until about 11 o'clock, and then I recollected myself,
so I went quietly to the office and got the file of the previous year,
and, with a little alteration, it did for the day's dinner as well." He
often mentioned what he designated his greatest mistake. He
described it thus:—"On the concluding day of George the Fourth's
visit, in 1821, he went to Powerscourt, where he got a splendid
reception from the noble proprietor. Lord Powerscourt had caused
reservoirs to be constructed above the waterfall, in order that when
his Majesty went to see it, the sluices might be drawn, and a
tremendous cataract produced. I went down in the morning and
viewed the place, and minutely noted all the preparations. I then
drew on my imagination for a description of a second Niagara, and
put into the mouth of the royal visitor various exclamations of delight
and surprise. I sent off my report, and it appeared in due time, but
unfortunately the king was too much hurried by other arrangements,
and did not go to the Waterfall at all, but drove direct from
Powerscourt House to Kingstown, where he embarked. I have been
often quizzed for my imaginative report, but, nevertheless, I stated
what the King ought to have done, and what he ought to have said,
and if he did otherwise, it was not my fault."
I was extremely fortunate, at my accession to magisterial office, to
find myself provided with clerks who could not be surpassed in
diligence, integrity, or intelligence. I shall particularize Messrs.
Pemberton and Cox. The former was the son of a previous chief
magistrate, at whose instance he was appointed. The latter had
been for several years in America, and had been engaged by Jacob
Philip Astor in forming the settlement of Astoria, in Washington
Irvine's description of which he is most favorably mentioned. He was
a man of great literary taste, and was an accomplished linguist.
Their performance of official duties never required from me, nor to
my knowledge from any of my colleagues, the slightest correction or
reproof. Pemberton was a solicitor, and was promoted in 1846 to the
Clerkship of the Crown for the King's County. He had been many
years before an assistant to Messrs. Allen and Greene, the Clerks of
the Peace for the City of Dublin. I shall have to notice hereafter
some amusing incidents connected with Cox, but shall give
precedence to a few anecdotes derived from Pemberton, and arising
from his acquaintance with the old Session House in Green Street,
and the records there, to which, I suppose, he had full access.
Towards the close of the last century an aid-de-camp of the then
viceroy was indicted, at the Quarter Sessions, for the larceny of a
handsome walking-stick, and also for assaulting the gentleman who
owned it, and who was, moreover, a Frenchman. The transaction
arose in a house of a description unnecessary to be particularized.
An affray took place, the Frenchman was kicked down stairs, and
lost his cane, which was alleged to have been wrested from him by
the aid-de-camp. The charge of larceny was absurd, and the grand
jury ignored the indictment. But the assault could neither be denied
nor justified, and the traverser submitted, pleaded "guilty," and was
fined five pounds. That punishment did not cure his propensity for
beating Frenchmen and taking their sticks. On the 21st of June,
1813, he beat Marshal Jourdan at Vittoria, and captured his baton;
and on the 18th of June, 1815, at Waterloo, he beat the greatest
Frenchman that ever lived, Napoleon Bonaparte. I do not feel
justified in naming the delinquent aid-de-camp, and perhaps the
reader may think it quite unnecessary that I should.
More than half a century has elapsed since the office of Recorder of
Dublin was held by Mr. William Walker, whose town residence was in
Lower Dominick Street. One day a groom, in the service of a Mr.
Gresson, was tried before him, for stealing his master's oats. The
evidence was most conclusive, for the culprit had been detected in
the act of taking a large bag of oats out of his master's stable, which
was in the lane at the back of the east side of Dominick Street.
When the prisoner was convicted, the Recorder addressed him to
the following effect:—"The sentence of the Court is, that you are to
be imprisoned for three calendar months; and at the
commencement of that term you are to be publicly whipped from
one end of that lane to the other, and back again; and in the last
week of your imprisonment, you are to be again publicly whipped
from one end of that lane to the other, and back again; for I am
determined, with the help of Providence, to put a stop to oat-
stealing in that lane." His worship's emphatic denunciation of oat-
stealing in that lane, arose from the circumstance of his own stable
being the next door to Mr. Gresson's.
The same civic functionary was a great amateur farmer. He had a
villa and some acres of land at Mount Tallant, near Harold's Cross,
and prided himself upon his abundant crops of early hay. On one
occasion he entered the court to discharge his judicial duties at an
adjourned sessions, and was horrified at hearing from the acting
Clerk of the Peace (Mr. Pemberton) that there were upwards of
twenty larceny cases to be tried. "Oh!" said he, "this is shocking. I
have three acres of meadow cut, and I have no doubt that the
haymaking will be neglected or mismanaged in my absence." In a
few minutes, he inquired in an undertone, "Is there any old offender
on the calendar?"
"Yes," was the reply, "there is one named Branagan, who has been
twice convicted for ripping lead from roofs, and he is here now for a
similar offence, committed last week in Mary's Abbey."
"Send a turnkey to him," said the Recorder, "with a hint that, if he
pleads guilty, he will be likely to receive a light sentence."
These directions were complied with, and the lead-stealer was put to
the bar and arraigned.
"Are you guilty or not guilty?"
"Guilty, my lord."
"The sentence of the court is that you be imprisoned for three
months. Remove him."
Branagan retired, delighted to find a short imprisonment substituted
for the transportation that he expected. As he passed through the
dock, he was eagerly interrogated by the other prisoners—
"What have you got?"
"Three months."
"Three months—only three months!" they exclaimed; "Oh! but we're
in luck. His lordship is as mild as milk this morning. It's seldom that
he's in so sweet a humour."
"Put forward another," said the Recorder.
"Are you guilty or not guilty?"
"Guilty, my lord."
"Let the prisoner stand back, and arraign the next."
Accordingly, the prisoners were rapidly arraigned, and the same plea
of "Guilty" recorded in each case. Presently it was signified to his
lordship that the calendar was exhausted. All the thieves had
pleaded guilty.
"Put the prisoners to the front of the dock," said he; and they were
mustered as he directed. He then briefly addressed them—
"The sentence of the court is that you and each of you be
transported for seven years. Crier, adjourn the court."
Branagan had been thrown as a sprat, and had caught the other fish
abundantly. This incident might afford a useful, or perhaps it should
be termed, a convenient suggestion, to other judicial functionaries,
especially on circuit when there is a crowded dock.
When Mr. Pemberton received the appointment of Clerk of the Crown
for the King's County, Mr. Cox, who had been for several years the
second clerk in the Head Police Office, succeeded to the chief
clerkship. He possessed very extensive knowledge of the world, and
was highly educated. Many incidents connected with him are worthy
of being recorded. I may mention here that the Police Laws of the
Irish Metropolitan district are, to the highest degree, complex,
voluminous, involved, and perplexing. In the English Metropolitan
district two statutes regulate, one the Police Force, and the other the
Police Courts. In Dublin we have a statute passed in 1808, another
in 1824, a third in 1836, a fourth in 1837, a fifth in 1838, a sixth in
1839, a seventh in 1842, and an Act in relation to public carriages,
which may also be termed a police statute, in 1848. They contain
three hundred and sixty-six sections, and may be designated as
disgraceful to the several executive governments which have left
them unconsolidated and uncodified. When the 5th Vic. sess. 2,
Chap. 24, passed, it recited the other Acts to which I have alluded,
and then its preamble proceeds to heap or bundle them all together
in the following terms:—

"Be it therefore enacted by the Queen's most Excellent Majesty,


by and with the advice and consent of the Lords Spiritual and
Temporal, and Commons, in this present Parliament assembled,
and by the authority of the same, that the said recited Acts of
the forty-eighth year of the reign of King George the Third, of
the fifth year of the reign of King George the Fourth, of the
session of Parliament holden in the sixth and seventh years of
the reign of King William the Fourth, of the first year of Her
present Majesty's reign, and of the sessions of Parliament
holden respectively in the first and second, second and third,
and third and fourth years of Her present Majesty's reign, and
this Act, shall be construed together as one Act; and that all and
every the enactments and provisions therein contained shall
apply and extend to this Act, and to all Convictions, Warrants,
Distresses, Proceedings, and Things, made, taken, or done in
execution of this Act, as fully to all intents and purposes as if
the same were herein repeated and re-enacted, save in so far
as such enactments and provisions are inconsistent with or
contrary to this Act, or as such enactments or provisions may be
altered by this Act, or other enactments or provisions made in
lieu thereof."

Mr. Cox commented on this farrago by observing that "its framer


would have an easy death, for that if he was affected with ague, or
even if he were hanged, he would be too lazy to shake in the former
or to kick in the latter case." In the blank leaf of a bound copy of the
Police statutes, the following was written in reference to the
preceding quotation:—

"The preamble saith the forty-eighth of George the Third is one,


that must be tack'd to another Act, the fifth of George his son.
Then whilst you're at it, just take a statute, the sixth and
seventh session, of him who did own the British throne, the
next in due progression. Then the first of the reign of our
present Queen, and then the first and second; the next that
occurred was the second and third, then the third and fourth is
reckoned. All these in fact, to the present Act, you must fasten
tight as leather. There may be flaws in many a clause, but, take
them all together, it must be your plan, as well as you can, to
deal with your numerous doubts, or be the employer of some
shrewd lawyer, to shew you their ins and outs. If your puzzled
brain, you rack in vain, until you fume and curse; if they bother
you, why they've bothered me too, so take them for better, for
worse."

There were, and I suppose still are, many complaints preferred


before divisional magistrates, at the Police Courts, in reference to
claims on Benefit or Friendly Societies, for allowances in cases of
sickness, or for money payable to members or their representatives,
under family visitations. Whenever any summonses on such subjects
were disposed of by me, I called for the transaction and account-
books, and required them to be produced at the commencement of
the proceedings. On one occasion a quire of copy paper, stitched in a
cover of brown, in a condition absolutely dirty, and in which the
entries were irregularly scrawled, was handed up to me. I strongly
censured such a slovenly mode of recording their proceedings as
very discreditable. On hearing the complainant, I considered that the
case was very well suited for an arbitration, and the parties offered
no objection to have it so disposed of; but they disagreed on each of
the other societies which were suggested for the purpose of deciding
it. However, one of the persons concerned said, that he would be
satisfied to leave the matter entirely to Paddy Flannery, whom he
saw present, and whom he considered "the most knowledgeable
man in all Dublin on such a business." The others concurred, and I
directed Mr. Cox to indorse on the copy of the summons a reference
by me, with the consent of the parties, of all matters in dispute
between them to the aforesaid Flannery. I proceeded with some
other business; and the indorsement having been made, I signed it
without any hesitation, and it was given to the late Mr. Charles
Fitzgerald, who was concerned in the case, but in whose honor and
probity all parties who knew him fully confided. In a day or two after,
I was talking to him, during a few minutes of leisure, and he showed
me the indorsement which I had signed. It was as follows:—

"This Benefit Society, which keeps no proper book, evinces


impropriety deserving a rebuke. As further litigation on each
part they decline, no other observation is requisite on mine. 'Tis
left to Patrick Flannery to judge of every fact, and in whatever
manner he thinks right they're bound to act. My order I reserve
until he makes out his award, and when he does, at once I will
the rule of Court record."

Dr. Ireland was, for many years, the principal surgeon of the Dublin
Metropolitan Police. He had to inspect the recruits, and satisfy
himself of their size, health, mental capacity, and bodily strength
being suitable to the service in which they proposed to engage. Cox
said that the Dublin Police was in one respect, very like to Howth
Harbor, as no one could get into either without passing "Ireland's
Eye." When the railway was being made from Dublin to Wicklow, he
said that its course through the County of Dublin was extremely
inharmonious, for it went first to a Dun-drum, proceeded to a Still-
organ, and then attained to a Bray.
Mr. Cox came into the Police Court one morning after the custody
cases had been disposed of. He brought forward an elderly female
whom he stated to be desirous of making a statutable declaration
before me, and which she had brought already drawn. There was a
peculiar expression in his countenance as he suggested that I might,
perhaps, be pleased to peruse the document previous to its official
reception. It was made under circumstances which I shall briefly
mention. A young man named Dempsey thought fit to embrace a
military life, and enlisted in the 97th Regiment. He did not give his
paternal name, but adopted the maiden name of his mother, and
was enrolled as Peter Moran. He served for some years in India, but
died there from the effects of sun-stroke. Some arrears of pay and a
share of prize-money were due at the time of his decease; and his
widowed mother applied, as next of kin, to obtain the amount. The
War-Office authorities did not understand how Peter Moran came to
be the son of Anne Dempsey. The declaration to which Cox slyly
drew my attention was intended to afford an explanation of the
grounds on which the claim was preferred, and it, moreover,
afforded an instance of a martial disposition being as early in its
inception as the birth-acquired tendency of poetic inspiration. The
declaration was as follows:—

"Police District of Dublin}


Metropolis, to wit,}
I Bridget Carey, of Fade Street, in the City of Dublin, widow, do
hereby solemnly declare that I am a midwife, and have been
such for the last thirty-five years; and I further declare that
about twenty-seven years ago, I attended Anne Dempsey who
was then living in Little Longford Street, in her confinement,
and, with God's assistance, I then and there safely delivered her
of the soldier in dispute, and I make this declaration for the
information of the Secretary-at-war, and the other authorities of
the War Office, &c."

Cox remarked, with an assumption of gravity which was irresistibly


comic, "I suppose, your worship, that it is not necessary to describe
the uniform or accoutrements in which 'the soldier' made his natal
appearance." The document was retained by me, and another was
substituted, in which the deceased was not accorded the distinction
of having been "born a soldier."
CHAPTER X.
MENDICANCY.

I think that some useful information may be blended with


amusement by offering to my readers a few anecdotes in reference
to mendicancy and the laws intended for its repression. Two persons
were charged before me at the Head Police Office, in 1843, with
begging in the public streets. One was detected in Castle Street and
the other in Palace Street. They were male and female, and stated
themselves to be brother and sister. Neither denied the commission
of the offence. Having been searched at the station-house, the man
was found to have £300 in his possession, and the woman had
£180. I do not recollect what names they gave, but I am sure they
were not the real ones. They were committed, each for a calendar
month, with hard labor; but during the period of their imprisonment
their subsistence was charged on the rates of the city of Dublin, and
the £480 were returned to them at their discharge. I have been
informed that the law of Scotland authorises the support of
vagrants, when committed to gaol, to be defrayed from money
found in their possession. If such be the case, I would suggest to
our Irish Members to have the law of this country, in cases of
vagrancy, assimilated to the Scotch system as quickly as possible.
Very soon after the occurence which I have mentioned, a gentleman
who resided at Kingstown, arrived there by train between seven and
eight o'clock, p.m. He was walking up the Forty-foot Road, when he
was accosted by a man of humble but decent appearance, who kept
by his side whilst addressing him. "I came out, sir," said this
individual, "early in the day, on an appointment with Mr. Herbert, of
Tivoli Terrace, as he promised to let me have a few pounds that he
owes me; but I found that he had to start suddenly for Bray on
some particular business, and he left word for me that he would be
back about ten o'clock, so I have to wait: and I declare, sir, that I
had only enough when I left home to get a return ticket, and I have
not had a bit to eat since morning. Might I ask you for as much as
would get me a crust of bread and a mug of milk." On reaching
George's Street, the gentleman handed him a sixpence, and received
the expression of an earnest prayer for his earthly prosperity and
eternal happiness. On the following evening, the gentleman arrived
at the same time, proceeded up the same road, and not being
recognized, was accosted by the same person, who told the same
tale, concluding with a wish for "the crust and mug of milk." A
constable happened to be in view, and the hungry applicant was
arrested and charged as a vagrant beggar. He had two ten-pound
notes and three of five pounds, with eighteen shillings in silver and
copper coin. The vagrant stated his name to be Richard Bryan, and a
most extraordinary document was found on him. It was soiled and
partly torn, but it was signed, "Your loving brother, John Bryan," was
dated, "Borris, August 30th, 1843," and contained a suggestion
which was fully acted on, and which I could not allow to escape my
recollection. Here it is:—

"We have got in the barley all right, and we are going at the
oats to-morrow. I had to lend the horses to-day to Mr. Kimmis. I
couldn't refuse, for you know he is a good warrant to obleege
us when we want a turn. Nolan is bothering about the rent. He
is very cross. You must see and make it out for him, if you were
even to beg for it."

One month's imprisonment, with hard labour, provided the


mendicant with some "crusts" and "mugs of milk" at the cost of the
county. The delinquent did not, I believe, resume his solicitations
within our district. The office sergeant who escorted him, with some
other prisoners, to Kilmainham, told the clerk at Kingstown on the
following morning, that Mr. Bryan stigmatized my decision as "most
uncharitable and disgusting."
I did not find mendicancy so persistent in any part of the police
district as in Kingstown. If a vagrant was brought up and punished
for begging in Rathmines or the Pembroke township, or if the
detection occurred at Inchicore, or in the more respectable parts of
the city, it was not at all probable that the beggar would be soon
found again in the same locality. The Kingstown vagrants, as soon as
they were discharged from Kilmainham, generally started off to
return and resume their solicitations at the piers and jetty, or about
the streets and terraces, which were more devoted to healthful
recreation than to professional or commercial affairs. I have no
doubt that mendicants from distant places receive more at
Kingstown or Bray, from visitors whom they recognize, or who
recognize them, than would be given to them if both parties were at
home. A lady with whom I was personally acquainted, and whose
family residence was near Carlow, has several times, in my
presence, given sixpences to beggars who belonged to her own
neighbourhood, and I have heard her tell them that Kingstown was
a better and more lucky place for them than ever they would find
Carlow to be. I shall close my observations on street begging, by
deliberately stating from my personal and official experience, that
not one penny can be given to any mendicant on our thoroughfares
in real, efficient, and merited charity. I would now warn my readers
against another kind of begging, which avails itself of very
systematic and elaborate means, and sometimes displays
considerable educational acquirements, namely, written applications
to charitable individuals to alleviate dire distress or succour
unmerited misfortune. I know that this system is extensively
practised in London, and I have heard that it is reviving in Dublin. I
use the term "reviving," because it was completely crushed here in
1844 by the intelligence and activity of the detective division. At that
time it was discovered that a confederacy of impostors had been
formed in Bridgefoot Street, and that the members of this nefarious
association were levying contributions on all in whose dispositions
they had ascertained charity and credulity to be united. Forty-one of
them were arrested and brought before me, and I committed them
for trial on charges of "conspiring to defraud, obtaining money under
false pretences, and forgery at common law." They were, however,
consigned to Newgate, exactly at the time when the State
prosecutions against O'Connell had been commenced; and it was the
received opinion in police quarters that they owed their escape—for
they were not prosecuted—to a feeling on the part of the attorney-
general of that period, that all his attention was demanded in
bringing down the eagle, and that none of his energies could be
spared to scatter a flock of kites. But they were not relinquished by
the detectives, and were brought in detail under the castigation of
the law until the confederacy was broken up. Their begging letters
and petitions were addressed to all whom they considered likely to
yield the slightest attention to their requests. These productions
were termed in their slang "Slums." One impostor represented that
she was a clergyman's widow, with four female children, the eldest
only eleven years of age; that her pious, exemplary, and most
affectionate partner had died of malignant fever, contracted whilst
whispering the words of Christian consolation to the departing
sinner, and imparting the joyful assurance, that the life flickering
away, the socket glimmer of a mere earthly light, would be rekindled
in a lamp of everlasting duration and unvarying brilliancy. That
resigned to her suffering, and adoring the hand from which she had
experienced chastening, she was not forbidden to hope that the
blessed spirit of charity would be manifested in her relief, and in
shielding her helpless, artless babes from the privations of distress in
their infancy, and from the still more fearful danger of being, in
advanced youth, exposed to the snares of sin and its depraving
consequences. A contribution, however small, addressed to Mrs.
——, at No. — Bridgefoot Street, Dublin, would, it was respectfully
hoped, be accorded by Lord ——, or Mr. or Mrs. ——, whose well-
known, though unostentatious benevolence, must plead the poor
widow's apology for such an intrusion. Another was an unfortunate
man, who for many years had earned a respectable livelihood as a
commercial agent, and supported a numerous and interesting family
by his industry and intelligence, but having unfortunately been in the
County of Tipperary, when a contested election was in progress, he
unguardedly expressed a wish for the success of the Conservative
candidate, and although not a voter, he was set upon by a horde of
savage ruffians, and beaten so as to produce paralysis of his lower
extremities, and that now nothing remained for him but to entreat
the humane consideration of one who could not, if the public
testimony of his, or her generous disposition, was to be credited,
refuse to sympathize with a parent whose helplessness compelled
him to witness, with unavailing anguish, the poignant miseries of the
offspring he had hoped, by his honest exertions, to have supported
and reared, without submitting to the galling necessity of soliciting
that aid which nothing but the most absolute destitution could
reconcile him to implore. A military lady announced herself as the
widow of color-sergeant Robert Maffett, who having served faithfully
for twenty-three years, the four last having been in India, had been
severely wounded in a decisive battle in Scinde, and when invalided
and pensioned, was unfortunately drowned at Blackwall, in
consequence of the boat which was conveying him ashore being
accidentally upset. That she and her eight poor orphans had no
resource on reaching her native city, where she found that all her
relations had died or emigrated, and where she was friendless and
alone, but to throw herself upon the charitable feelings of one
whose character emboldened her to hope that the humble appeal of
the soldier's widow, for herself and her poor orphans, would not be
unavailing. These and a thousand other slums were manufactured in
Bridgefoot Street, alias Dirty Lane, not an unsuitable name for the
locale of such proceedings, and they were invariably accompanied by
lists of subscriptions, and magisterial or municipal attestations,
admirably got up in the first style of forgery. In the first case to
which I have adverted, the "hapless widow" succeeded in getting
five pounds from the Lord Chief Justice of Ireland (Pennefather). In
the instance of the "military widow," Lady Blakeney was lightened of
three pounds. Another slum was circulated by a scoundrel who
represented himself to be the son of a gentleman in the south of
Ireland, of an old family, and of the pristine faith; that he had been
educated at Louvain, had an ardent wish to become a Catholic
clergyman, and that one of the most distinguished dignitaries of that
church was inclined to ordain him, but his father had died in debt,
without leaving him the means of providing even the most humble
outfit for such a vocation. One of his missives produced the effect of
relieving an alderman's lady of five pounds sterling, which the
excellent and worthy matron piously suggested might be useful in
providing the embryo priest with vestments.
This confederacy was not confined to Dublin. Its branches extended
through Leinster, Connaught, Munster, and in almost every important
town in England its connections were established. It is, however,
very curious that the Scots and our Northern countrymen were left
comparatively free from its attacks. Why? Is it because the rascally
crew conceived the natives of Scotland and Ulster to be more
cautious or less benevolent than their respective Southern
neighbours? The reader may judge for himself; but swindlers are
not, in general, very wrong in their estimate of character or
disposition.
The head-quarters of the society were in an obscure country town in
an inland county of Ireland, and there the materiel of the association
was seized, according to my recollection, in April, 1844. There was
found at the source of their system, a chest of very elegant
manufacture, and containing, in compartments, admirably executed
counterfeits of the public seals of Cork, Waterford, Limerick, Sligo,
Drogheda, Dublin, Liverpool, Bristol, Hamburg, Havre, and New
York. These were used to seal forged certificates and attestations,
which were transmitted for use to more populous places; but the
seals were cunningly kept in a remote, and for a long time, an
unsuspected locality.
CHAPTER XI.
CARRIAGE COURT CASES—DUBLIN CARMEN.

When I assumed, by an arrangement with my colleagues, the


regulation of the public vehicles, and the disposal of complaints in
the Carriage Court at the Head office, announced my inflexible
determination to cancel the license of any driver who was proved to
have been drunk while in charge of his vehicle on the public
thoroughfare required the fullest proof of the offence, to whom I
awarded the highest punishment. I am happy to say that such cases
were by no means frequent, but there were some, and they
generally occurred at funerals. A Rathfarnham carman was
summoned before me and was convicted, not only on the clearest
evidence, but by his own admission. He was about my own age, and
I remembered that when I was about eighteen years old, I was one
day swimming in a quarry-hole at Kimmage, where the water was at
least twenty feet deep, and was suddenly seized with very severe
cramps in my left leg. I kept myself afloat and shouted for help, but
I was unable to make for the bank, when a young fellow who had
been swimming, and was dressing himself, hastily threw off his
clothes, plunged into the water, and pushed me before him to the
side of the quarry. He saved my life, and I now beheld him in the
person of the convicted carman. I related the circumstance from the
magisterial bench, and then cancelled his licence, and remarked to
those who were assembled, that when I treated the preserver of my
life so strictly, others could not expect the slightest lenity at my
hands if they transgressed in the same way. The poor fellow left the
court in great dejection, and when my duties for the day were over, I
dropped in to my friend Colonel Browne, the Commissioner of Police,
and mentioned the circumstance to him. He said, "You cancelled his
licence, but I can give him a new one, and he shall get it to-
morrow." The licence was accordingly renewed, without causing me
the slightest dissatisfaction.
Most of my readers are aware that the Richmond Bridewell, which is
now the common gaol of the City of Dublin, is situated near Harold's
Cross; and that on its front is inscribed, "Cease to do evil. Learn to
do well." A carman named Doyle, who lived at Blackrock, was
summoned before me on charges of violent conduct, abusive
language, and extortion. He was a man of very good character, and
the complainant was a person of the worst reputation, who had
been convicted of several misdemeanors of a very disgraceful
nature. Frauds and falsehoods were attributed to him as habitual
and inveterate practices. He was sworn, and then he described
Doyle as having been most abusive and insulting in his language, as
having threatened to kick him unless he paid much more than the
rightful fare, and as having extorted an extra shilling by such means.
The defendant denied the charges totally, and declared that the
accusation was false and malicious. He then asked me to have
Inspector O'Connor and Sergeant Power called and examined as to
the complainant's character, and whether he was deserving of being
believed on his oath. From my own personal knowledge of the
complainant's reputation, I willingly acceded to the demand, and
desired that the required witnesses should be called from the upper
court, where they were both attending. Whilst we were waiting their
appearance, Doyle made a speech; it was very brief, and I took it
down verbatim; he said:—
"Your worship, if I get any punishment on this man's oath, it will be
a wrong judgment. The Recorder knows him well, and he wouldn't
sintence a flea to be kilt for back-biting upon his evidence. He has
took out all his degrees in the Harold's Cross college; and if, instead
of sending me to the Cease to do evil hotel, you had himself brought
there, the door would open for him of its own accord, for there is
not a gaol in Ireland that would refuse him. He swore hard against
me, but thanks be to God, he did not swear that I was an honest
man, for there is nobody whose character could stand under the
weight of his commendation."
On the evidence of O'Connor and Power, I dismissed the charge, and
subsequently spoke of the case, and repeated Doyle's speech in
festive society. When Boucicault produced his interesting Irish drama
of Arra-na-pogue at the Theatre Royal, I was one of his gratified
audience, and was greatly surprised at hearing the speech which
had been originally delivered before me in the Carriage Court by the
Blackrock carman, addressed to the court-martial by Shawn-na-
poste, to induce a disbelief of the informer by whom he was
accused. I subsequently ascertained that it had been given to
Boucicault by one who could fully appreciate its originality and
strength, my gifted friend, Dr. Tisdall.
The Dublin carmen are far from being faultless, but, as a class, I
found them generally very honest. Whilst I discharged the carriage
business, I knew instances of considerable sums of money and
articles of value, which had been left in their vehicles, being brought
in and delivered up to the police. I do not know how such property,
if unclaimed, is now disposed of; but in my time, I invariably, after
the expiration of twelve months, had it delivered, subject to charges
for advertising, &c., to the person who brought it. I may mention
one very extraordinary incident. Before the opening of the Great
Southern and Western Railway, the Grand Canal Company ran
passenger boats to the towns of Athy and Ballinasloe. A boat for the
latter place left Portobello each day at two o'clock. A Rathmines
man, who was owner and driver of a covered car, was returning
home one morning about 11 o'clock, when he was hailed, in Dame
Street, by a respectably dressed man, who engaged him to drive
about town, and to be paid by the hour. The hirer stopped at several
establishments and bought parcels of woollen, linen, plaid, and
cotton goods, as also a hat and a pair of boots, for all of which he
paid in cash. There was merely room for the hirer in the vehicle
along with his ample purchases. Finally, he directed the driver to go
to Portobello, adding that he intended to leave town by the passage-
boat at two o'clock. When the car arrived at the end of Lennox
Street, the driver was ordered to stop. The hirer alighted and told
the driver to go round by the front of the hotel and wait for him at
the boat. The order was obeyed, and the carman waited until the
boat started, but the hirer did not appear. The driver apprized the
police of the circumstance, and, at their suggestion, he attended the
two boats which left on the following day, but no one came to claim
the goods. They were brought to the police stores and advertised,
the hirer was described and sought for in various hotels and lodging-
houses, but without any result. It was ascertained at the
establishments where the parcels were purchased that they cost
twenty-seven pounds, and the carman ultimately got them on paying
some small charges. He had not been paid his fare, nevertheless he
was not dissatisfied. A rare case amongst his fraternity.
When it was proposed to have a hackney fare for sixpence, "for a
drive with not more than two passengers, direct, and without any
delay on the part of the hirer, from any place within the municipal
boundary to any other place within the same," I refused to sanction
such a regulation. I considered that it would, in many instances, be
a most inadequate payment for the employment of a vehicle. I
suggested that the fifteen municipal wards should form three
districts of five wards each, and designated, Southern, Middle,
Northern. I proposed that a drive entirely in one of those districts
should be a sixpenny fare, that from South or North to Middle, or
vice versa, should be eightpence, and that North to South, or vice
versa, should be tenpence. My suggestions were not even
considered, for the carmen published advertisements that they were
desirous of giving cheap locomotion to the people of Dublin, but that
the magistrate refused to allow them to take small fares. I sent for
the "runners," as the attendants on the stands were termed, and
told them that I should no longer object to the sixpenny fare which
was proposed. I added that it was the carmen's own act, and, to use
a homely phrase, "as they had made the bed, nothing remained for
me but to compel them to lie in it." The by-law was no sooner in
operation than numerous cases of its violation were brought before
me. I fined each, if I thought it fully proved, in the maximum penalty
of two pounds. One delinquent was extremely urgent to have a
smaller penalty inflicted. I recognized him as having been present
when I used the phrase which I have quoted, and reminded him that
he had been fully warned. He replied, "Yes, yer worship, we did
make the bed, and you promised to make us lie in it, but we never
thought that it would be so heavily quilted."
I held that any stop or deviation from the direct line between two
places, at the hirer's instance, voided the sixpenny contract, and
entitled the driver to additional remuneration. I often availed myself
of a sixpenny lift, and was taking one in which I passed the
Shelbourne Hotel, in front of which there was a "hazard," or branch
stand for five or six cars or cabs. It was considered very
objectionable for a disengaged vehicle to stop alongside a hazard
and thus obstruct the carriage way. I observed a jarvey committing
this offence, and desired my driver to "hold a moment." I said to the
offender, "If a constable takes your number for obstructing, you will
not escape for less than ten shillings." I then bid my man to go on.
He replied, "Yes, yer worship, and it would serve that fellow right to
have him punished, for he is after putting your worship in for
another sixpence to me."
Two of my daughters had gone to make some purchases at the
establishment of Messrs. Todd and Burns, in Mary Street. They were
engaged to spend the afternoon at a house in Leinster Street. Rain
was falling, and the elder beckoned to the driver of a covered car
who happened to be passing. They got into it, and desired him to go
to No. 14 Leinster Street. When they arrived, the elder let her sister
pass before her into the house, and then she offered a sixpence to
the carman. He declined to take it, and said that she should give
"the father or mother of that." She asked how much did he demand?
and the reply was "a shilling at least." She then said that she would
get half-a-crown changed in the house, and bring him a shilling, but
she added "that she would speak to papa about it." "Musha, who is
papa?" said he. "Mr. Porter," was the reply. She went in, got the
change, and came back with the shilling, but he was gone. He
preferred giving her a gratuitous drive to having my opinion elicited
in reference to the transaction.
A cavalry regiment, if I recollect rightly it was the "Scots Greys,"
occupied the barracks at Island Bridge in 1854. One day an outside
jaunting-car was waiting in the barrack-yard, and the driver was
standing on the step. He was a few yards from the quarters of a
Captain B——, who was reputed to have a private income of £15,000
per annum. The officer was amusing himself with a little gun, which
discharged peas and leaden pellets by detonating caps with greater
force than the captain was aware of. He shot at the carman, and the
pellet passed through his overcoat and reached his back, giving him
a smart blow, but without penetrating the skin. The driver was
looking round, and expressing his displeasure, when he received a
second shot, which, striking the calf of his leg, lodged in the flesh.
He instantly whipped his horse, drove rapidly away, and betook
himself to the Meath Hospital, where the shot was extracted. He
summoned the officer before me, and when the facts were stated, I
expressed an opinion that the act was most unjustifiable, that a
wanton and very severe assault had been committed, but that I
thought it originated more in a spirit of foolish fun than in any wish
to injure the complainant, and as it was a misdemeanor, the parties
might come to an understanding, which would render further
proceedings unnecessary.
The captain accosted the carman—"Will you take one hundred
pounds?"
"Of coorse, I will, yer honor, and I'll never say another word, even if
you war to shoot me agin."
Two fifty-pound notes were handed to the delighted complainant,
who then said to me—
"The business is settled, yer worship, and I can only say that when I
was hit, although it gave me a great start, I felt satisfied it was a
rale gintleman that shot me."
I advised the captain to discontinue the sport of jarvey-shooting.
Cox complimented him on his generosity, adding that he ought to
have got a large covey of such game for the price he paid. I regret
to add that the money did not improve its recipient. He relapsed into
habits of idleness and drunkenness, lost his licence through
misconduct, and was reduced to complete destitution.
A gentleman, who lived in Baggot Street, came to Exchange Court
one morning for the purpose of reporting that his coach-house had
been entered, as he believed, by means of false keys, and that a set
of cushions, adapted to an outside jaunting-car, had been
abstracted. He described them as white cord material with green
borders and seams. A detective mentioned that he had seen
cushions of the description on a car which had been brought for
inspection, and the licence of which had been suspended on account
of its unseemly condition. The car was then in Dame Street, and a
further enquiry eventuated in the discovery on it of the articles
which had been supposed to have been abstracted. The owner of
the car was a brother of the gentleman's servant who had lent his
master's cushions to pass the inspection. The car licence was
cancelled; but I believe that similar tricks were frequently played on
similar occasions.
For upwards of ten years I have been estranged from the Dublin
Police Courts. I cannot speak as to the habits and characteristics of
the carmen of the present time. I have already stated that,
according to my experience and recollection, they were honest and
sober. I can add that I knew many instances in which members of
their class manifested generosity, kindness, and courage. A man
belonging to New Street stand went to the fair of St. Doulagh's, and
expended his savings in the purchase of a fine-looking horse that
appeared in a sound condition, but on whose leg there was a slight
scar. In about a week after the fair, the beast exhibited some very
extraordinary symptoms, and at last became most furious and
unruly. He dashed into a shop window, and injured himself so much
as to make it necessary to kill him. It was the opinion of a veterinary
practitioner that he had been bitten by some rabid animal, and had
taken hydrophobia. The other carmen promptly subscribed a sum
sufficient to defray the damage done to the shop, and to procure
another horse for the man who vainly sought to ascertain the former
owner of the one that he bought at St. Doulagh's. I am aware that
previous to the establishment of the fire brigade in Dublin, the
drivers on a car-stand would leave two or three of their number to
mind their horses and vehicles, and apply themselves to work the
engines and extinguish fires in their vicinity. Many acts of heroism on
the part of carmen have occurred on our quays and at Kingstown, in
saving, at their own imminent risk, persons in danger of drowning.
Having noticed some very good qualities, I must remark on the
scarcity amongst them, according to my experience, of veracity.
When a carman was summoned by a constable he almost invariably
met the accusation by a direct contradiction. If called on to answer
for being shabbily dressed or dirty in his apparel, he bought or
borrowed a good suit of clothes, shaved, put on a clean shirt, and
stated boldly to me that he was just in the same attire when the
policeman "wrote him." If the summons was for being absent from
his beast and vehicle, he insisted that he was holding "a lock of hay"
to his horse all the time. If the complaint was for furious driving, the
defence was that "the baste was dead lame, that it was just after
taking up a nail, and was on three legs when he was 'wrote.'" If it
was alleged that the horse was in a wretched condition, and unfit to
ply for public accommodation, he expressed his surprise that any
fault should be found with a horse that could "rowl" four to the
Curragh and back without "turning a hair." Whatever statement was
made for the defence, it evinced imaginative power, for the plain,
dull truth was hardly ever permitted the slightest admixture in the
excuse offered. Mr. Hughes, whom I have mentioned in some earlier
pages, was in the carriage-court one day, on an occasion when an
old man named Pat Markey, formerly belonging to the Baggot Street
stand, made a statement utterly at variance with all probability, and
directly opposed to the evidence adduced against him: however, on
the prosecutor's own showing the case was dismissed, as the charge
was not legally sustained. On leaving the court, Hughes asked Pat
why he did not tell the truth at first, as it would have been better for
him; upon which the other exclaimed—"Musha, cock him up with the
truth! that's more than I ever towld a magistrate yit." A delinquent
seldom mentioned the offence for which he was punished; he
generally substituted for it, the inducement which led to its
commission. If he went into a tobacconist's, and while he made his
purchase, his horse moved on, and was stopped by a constable, who
summoned the driver, the latter when asked what he was fined for
would reply, "for taking a blast of the pipe." If, on a Saturday
evening, he betook himself to a barber's shop to have the week's
growth taken off his chin, and incurred a penalty for being absent
from his vehicle, he said, "the polis wrote him" for getting himself
shaved. And on Sunday morning, if a devotional feeling prompted
him to get "a mouthful of prayers," whilst his beast remained
without any person to mind it, upon the public thoroughfare, he
expressed his indignation at a consequent fine "for going to Mass."
I found it impossible to adapt the law, as it existed in my time, so as
effectually to compel the carmen to keep themselves in cleanly,
respectable attire, or their vehicles in proper order. When summoned
and fined, their comments evinced the inutility of the punishment. I
have said to one, "Your car has been proved to be in a most
disgraceful state, and I shall fine you ten shillings." The reply has
been, "I thank yer worship, shure that fine will help me to mend it."
I have told another that I would suspend his licence for a month;
but this only elicited a request for an order to admit him and his
family to the poorhouse during the suspension. If the complaints
preferred by the police did not effect much good, those brought
forward by private individuals were, in their general tendency, and as
a class of cases, decidedly injurious. When extortion, violence,
insolence, or an infraction of duty provoked an aggrieved person to
summon, the usual course was for the delinquent to send his wife to
the complainant's residence, or sometimes to borrow a wife, if he
had not one of his own, to beg him off. In the case of a young lad
being the offender, the intercession was managed by his mother,
whether the maternity was real or pretended. The afflicted female
beset the door, and applied to all who passed in or out "to save her
and her childher, or her poor gorsoon, from the waves of the world,"
that Mr. Porter was a "rale Turk," and if the poor fellow was brought
before him, he would be destroyed "out of a face." A riddance of
such importunities formed no slight inducement to forego the
prosecution, and consequently the majority of such cases were
dismissed for the non-appearance of the complainant; but
sometimes the fellow who had been "begged off" came forward,
stated that he was ready to answer the summons, and insisted on
his loss of time being recompensed by costs. I must admit that I
always complied with such applications, and I have enjoyed
frequently the vain remonstrances of the forgiving party, who, for his
mistaken and expensive lenity, acquired nothing but the wholesome
warning not to summon a Dublin driver without appearing to
prosecute.
Although the carmen were rather fond of getting more than their
fare, they became the dupes and victims of dishonest and tricky
employers, and, to use their own term, were "sconced" much more
frequently than was generally supposed. The Four Courts
constituted, in my time, the frequent scene of such rascality. There
was seldom a day in Term that some poor carman was not left
"without his costs" by a plausible fellow, who alighting at one door,
and passing through the hall, went out at another, leaving the driver
with the assurance, that "he would be back in a minute," to find that
he had been employed, for perhaps an hour or two previously by a
heartless blackguard, who desired no better fun than "sconcing"
him. I believe that a regulation has been since adopted which
authorises a driver engaged by time to require payment in advance.
I consider it a very great improvement.
CHAPTER XII.
A GRATUITOUS JAUNT—THE PORTUGUESE
POSTILLION—MISCELLANEOUS SUMMONSES.

A young woman who was servant in a house in Harcourt Street in


which two students resided, had an altercation with one of them,
which eventuated in a summons and a cross-summons before me. It
appeared that the young man had imputed dishonesty to her, and
she had been very indignant and abusive towards her accuser. He
called his fellow-student as a witness, to prove that the girl threw a
bottle at him, and that she freely used the terms of swindler,
blackguard, &c. The charge of dishonesty was unfounded, and the
encounter between the parties terminated without any personal
injury to either, but the damsel cross-examined the witness in
reference to a transaction, and elicited a mode of procuring a jaunt
across the city, which I hope that I shall not lessen the reader's
interest in my observations and reminiscences of the Dublin carmen
by briefly detailing. The woman acquired the knowledge of it by
having overheard a conversation between the young men.
They had been invited to an early evening party at Summer Hill.
They were not inclined to walk such a distance, and neither of them
found it convenient to pay for a vehicle. At last the one who
subsequently complained of being termed a swindler and blackguard
said that he would get a covered car without payment. Accordingly,
having walked to the nearest "hazard," he desired his comrade to
get into a car, and also seated himself, he then directed the driver to
proceed "to Santry." "Santry!" explained the astonished jarvey; "is it
joking you are? D——l an inch I'll go to Santry to-night. Get out of
my car if you plaze, the baste is tired, and I won't go." "My good
fellow," was the answer, "I shall not get out, and you may as well
get on at once." "By gorra, if you don't get out, I'll pull you out,"
said the carman. "If you lay a finger on me," answered the
occupant, "I will resist you as well as I can, and I shall prosecute
you for an assault." It was a bad business. The carman changed his
tactics. "Why, yer honor," he mildly urged, "it is an unrasonable thing
to ax a man to go to such a place even in the day time, for there's
nothin but murdher and robbery on that b——y road, an' if I do go,
we'll be all kilt, and you'll be robbed into the bargain; shure you
haven't right sinse to think of such a jaunt." "My friend," said the
fare, "there may be something in what you say, but I shall call at a
house on Summer Hill and get firearms for myself and my
companion, and with two case of pistols I fear no robbers." The
carman grumbled, but he had a sturdy customer, so he mounted his
seat and drove on. When they came to Summer Hill he was desired
to pull up, and the two sparks alighted, assuring him that they would
immediately procure the arms and resume their journey. As soon as
they were inside the hall-door, the jarvey plied his whip, and rattled
off as fast as he could, congratulating himself that he had escaped a
drive to Santry, and leaving the two scamps to enjoy the joke of
having got a gratuitous jaunt from Harcourt Street to Summer Hill.
There was at the time of my appointment to the magistracy, a car
proprietor in Dublin, whose name was Bittner. His father had been a
sergeant in the King's German Legion, had been invalided, and died
in Dublin about the year 1810, leaving one son, who was then
sixteen years of age. He was tolerably educated, intelligent, cleanly,
active, and well-looking. A gentleman who was in delicate health,
engaged the lad as his personal attendant, and was soon after
advised by his physicians to betake himself to the south of Europe,
in the hope of checking the progress of pulmonary disease. Lisbon
was the only available place to the invalid, and he proceeded there,
along with his youthful servant. He lived in Portugal for nine or ten
years, and was so well satisfied with the care and attention of
Bittner that he left him a legacy of £250. The gentleman's body was
directed by his will to be interred in Dublin, whither it was conveyed
by the faithful domestic. Bittner did not squander his money, neither
did he become inactive. He was fond of horses, and of equestrian
exercise, and engaged in the service of the late Mr. Quin, of Bray;
then the proprietor of an extensive hotel and first-rate posting
establishment. The romantic scenery of Wicklow was then, as it
must ever be, highly appreciated, and Quin's chaises conveyed many
visitors to the varied and numerous scenes of picturesque beauty.
On one occasion Bittner was directed to bring a chaise to the door,
to take two foreign gentlemen through the Glen of the Downs, and
on to Dunran. The travellers were quite unacquainted with the
English language, and in the hotel, had recourse to signs and self-
attendance as much as possible. They got into the chaise, having
previously pointed out on a map to Mr. Quin, the route they wished
to take. On arriving at the gate of Dunran, they made signs to stop
the vehicle, and alighted. They then began to bewail to each other,
their ignorance of English, and their consequent inability to acquire
information as to the scenery, residences, and other particulars
usually interesting to tourists. They spoke Portuguese, and Bittner
immediately accosted them in their own language, told them that he
would procure a person to mind his horses, and that he would then
take them up to the "View Rock," and conduct them to each of the
many places worthy of their observation. They expressed the highest
gratification, and availed themselves of his services. As they
proceeded, he told them that Mr. Quin's was the greatest and best
regulated establishment in the world. That there were postillions
kept there who had been procured from every European nation. The
French postillions had gone with a party of their countrymen to the
"Seven Churches," and two Germans and one Italian had left, early
in the morning, for the Vale of Ovoca. The Spaniard was gone to
Luggelaw. "I," said he, "am the Portuguese postillion, I am delighted
to have you, and can take you to all the beautiful places in Wicklow,
but I am afraid that I shall soon have to leave this employment, for
we hardly ever have a Portuguese gentleman at the hotel, so my
chances are very poor." The travellers, driven by Bittner for about a-
week, went to all the delightful scenery of Wicklow, and when
departing, gave him a couple of sovereigns. In about three months
after, Mr. Quin received a parcel in which there were two nicely
bound volumes, and a complimentary letter, sent from Lisbon by Don
Pedro Cabrito. With some difficulty he got the letter translated, and
also a couple of pages which had been turned down to attract his
attention. He was then made aware that the Portuguese traveller
accorded the highest praise to the comfort and elegance of his
establishment, and also to his anxiety to convenience his foreign
visitors, by keeping postillions, who, in the aggregate, were
acquainted with all European languages. The book also made
honorable mention of the "Portuguese postillion," Bittner. The latter,
as I have already stated, became a car proprietor. His vehicles were
cleanly and neat, his drivers well conducted, and a complaint against
him was of very rare occurrence. On one occasion, after I had heard
an explanation from his driver, he asked my leave to say "a word or
two," to which I replied, "With pleasure, Mr. Bittner, I shall hear you,
provided you do not speak Portuguese." "Oh! your worship," said he,
"I see you know that story. I suppose Mr. Quin told you." His
supposition was correct.

A FEW HYPERBOLES.
One of the clerks in the police-court of Liverpool got leave of
absence in, as I best remember, 1845. He came to Dublin with some
other young Englishmen for a few days of recreation. Curiosity
induced him to visit our police-courts, where our clerks received him
with fraternal courtesy. He told Mr. Cox that he and three others took
an outside car, for a suburban drive. It happened to be on Corpus
Christi day, and they were going along Rathmines road, just as the
religious procession incident to the festival was moving round the
extensive court outside of the Roman Catholic chapel there. They
directed the driver to stop, and then stood up on the seats to obtain
a full view. Almost immediately one of them exclaimed, "Well, that
beats the devil!" The carman touched his hat to the exclaimer and
replied, "Yes, your honor, that's what it's for." I have heard the late
Judge Halliburton (Sam Slick the clock-maker) say, that he asked a
carman what was the reason for building the Martello towers? and
that the interrogated party told him, "he supposed it was, like the
round towers, to puzzle posterity."
The Spaniard, who described the rain as so heavy, that "it wetted
him to the marrow," was not so poetical or forcible in his hyperbole
as some of our jarveys have been. I recollect reading in a little work,
published many years ago, and entitled "Sketches of Ireland," that
when a gentleman complained of the choking dust of the Rock road,
and declared that he did not think it possible for a road to be so
dusty, his driver remarked, "It's thrue for yer honor! but this road
bates all others for dust, for, by all accounts, there was dust on this
road the day after Noah's flood." A lady who resided at Chapelizod
was wont to give a carman whom she frequently employed a glass
of grog, along with his fare, at the conclusion of each engagement.
However, she became too sparing of the spirits, or too generous of
the water, but the grog eventually became so weak, that its recipient
criticised it, of course with an oath, by asserting, that "if you threw
half-a-pint of whisky over Essex Bridge, you might take up as strong
grog as that at the Lighthouse."

MISCELLANEOUS SUMMONSES.
According to my recollections of the summons cases of a police-
court, apart from carriage complaints, I feel justified in remarking on
the mild and forgiving tendencies of the men, and the vindictive
rancour of the women of Dublin. From recent conversations with
police functionaries, I am disposed to believe that the present time
differs in no material respect from the past. The man claims the
protection of the law; "he has no desire to injure the parties he
complains of, but he wants them bound to the peace, just to keep
them quiet." The woman wants "the coorse of the law, and to have
her adversary chastised and kept from killing the whole world, like a
murdhering vagabone as she is; it's no use in talkin', but the street
will never be quiet until she gets some little confinement just to larn
her manners." Summonses for abusive language, or as the fair
complainants term it, "street scandal," are, perhaps, the most
numerous cases as a class; and on the hearing of them, there is
frequently elicited an amount of vituperation beyond anything that
Billingsgate could attempt to supply. In almost every case a total
absence of chastity is imputed as a matter of course; and if a
foreigner would only believe both sides of a police summons-book,
he would be forced to the conclusion that chastity was a virtue rarely
found amongst the lower order of Dublin females. Yet the very
contrary is the fact: furious in their resentments, uncontrollable in
their invectives, and inveterately addicted to assassination of
character, they are, in general, extremely chaste; and attest the
value they attach to female virtue by invariably imputing its absence
to their opponents. Sometimes, indeed, a novel term of reproach
arouses volcanic fury, and an eruption of indignation is excited by
the most extraordinary and unmeaning epithet. I cannot forget a
fish-vendor from Patrick Street vociferating to me, that if her enemy
was not sent off to Grangegorman at wanst, her life and her child's
life (for she was enceinte) would be lost. "But what did she say?"
was my query. "What did she say! yer worship, what did she say!
Why she came down forenenst the whole world at the corner of
Plunket Street, and called me 'a b——y ould excommunicated
gasometer.'" I may mention that as female invective generally
ascribed inconsistency to its opponent, so the male scolds—happily
not very numerous—had their favorite term of reproach; and when
they wished to destroy a man's reputation, they designated him—a
thief?—no; a robber?—no; a murderer?—no; they satiated all their
malignity in calling him "an informer."
Disputes between manufacturers and their artisans or workmen
were very rarely the subject of magisterial investigation. There was,
however, one case disposed of by me in which a comparison was
instituted of a most extraordinary nature. A journeyman summoned
an employer for abruptly dismissing him, without giving him,
according to the usage of the trade, "a week's notice or a week's
wages." I shall not mention the name, residence, or trade of the
defendant: but I must say that his countenance exhibited the
greatest obliquity of vision that I ever observed in a human face. All
the trite phrases commonly applied to squints would fail adequately
to describe the tendency of his eyes to avoid seeing the same object
at the same time. He admitted having summarily discharged the
workman, and alleged that the complainant had totally spoiled an
article which he had been directed to make in a hexagon form, and
conformable to a pattern supplied, and had produced a piece of
work in which shape and proportion had been totally disregarded.
The complainant insisted that the work had been properly done, and
in complete conformity with the model, and he asked why it was not
produced, so that I might judge, by viewing it, whether it deserved
to be condemned as crooked and shapeless. I suggested a
postponement of the case, and the production of the condemned
article. The defendant, who was rather excited, replied, "Your
worship, I was so vexed when it was brought in, that I threw it out
of the window of the finishing room into the yard, and it was
smashed to pieces, but I am ready to swear, in this or any other
court, that it was as crooked as the two eyes in my head." The laugh
in which I indulged, at hearing this comparison, was lost in the
risibility of all present. I suggested that the parties might come to an
understanding, and that the complainant might be afforded another
opportunity of making an article perfectly conformable to the
pattern, and without any resemblance to anything else. This was
agreed to, and they departed reconciled.

You might also like