You are on page 1of 30

BLAISE

BLAISE PASCAL
PASCAL MAGAZINE
MAGAZINE
28
28
D E L P H I,

L A Z A R U S,

OXYGEN

(P R I S M), A N D

PASCAL

RELATED

LANGUAGES

NEW AND ENHANCED FEATURES IN DELPHI XE4


Alternative datastreams (ADS)By Jean Pierre Hoefnagel
alternative and a far better inifile

First Look at FireDAC By Cary Jensen


Writing UI-Independent Code with Anonymous Methods
By Marco Cant

Introduction to Databases Part 12: A DataSnap Client By Cary Jensen


the effects of Authentication and Authorization
Programming in Smart: Refactoring By Primo Gabrijeli
refactoring and the code of the Todo list
Development for lazarus part two By Joost van der Sluis
additional extras for simple development
Matching files By Peter van de Sman
Bookreview By James D (Jim) Duff
Start Programming using Object Pascal Free Pascal/Lazarus Book
Delphi XE4 iOS DataSnap Clients By Bob Swart
Intro to kbmMW connectivity package 'Spider ' By Fikret Hasovic

2 / 2013
Publisher: Foundation for Supporting the Pascal Programming Language
in collaboration with the Dutch Pascal User Group (Pascal Gebruikers Groep)
Stichting Ondersteuning Programmeertaal Pascal

28
BLAISE
BLAISE PASCAL
PASCAL MAGAZINE
MAGAZINE 28
D E L P H I,

L A Z A R U S,

OXYGEN

(P R I S M), A N D

PASCAL

RELATED

CONTENTS

V O L U M E 2 8,

I S S N 1 8 7 6-0 5 8 9

Editor - in - chief
Detlef D. Overbeek, Netherlands
Tel.: +31 (0)30 890.66.44 / Mobile: +31 (0)6
21.23.62.68

Articles
NEW AND ENHANCED FEATURES
IN DELPHI XE4
Alternative datastreams (ADS)
By Jean Pierre Hoefnagel
alternative and a far better inifile

page

page 14

First Look at FireDAC


By Cary Jensen

page 16

Writing UI-Independent Code


with Anonymous Methods
By Marco Cant

page 18

Introduction to Databases Part 12:


page 23
A DataSnap Client By Cary Jensen
the effects of Authentication and Authorization
Programming in Smart: Refactoring
By Primo Gabrijeli
refactoring and the code of the Todo list

Page 34

Development for lazarus part two


By Joost van der Sluis
additional extras for simple development
Matching files by Peter van de Sman
Bookreview By James D (Jim) Duff
Start Programming using Object Pascal Free Pascal/Lazarus Book

News and Press Releases


email only to editor@blaisepascal.eu
Authors
A
B
C
D
F
G
H
J
L
M
N
O
P
S

Alexander Alexeev
Peter Bijlsma,
Michal Van Canneyt, Marco Cant,
David Dirkse, Daniele Teti
Bruno Fierens
Primo Gabrijeli,
Fikret Hasovic
Cary Jensen
Wagner R. Landgraf, Sergey Lyubeznyy
KIm Madsen, Felipe Monteiro de Cavalho
Jeremy North,
Tim Opsteeg, Inoussa Ouedraogo
Howard Page-Clark,
Henk Schreij, Rik Smit, Bob Swart,

Editors

Page 42

Peter Bijlsma, W. (Wim) van Ingen Schenau,


Rik Smit

Page 46
Page 48

Correctors

Delphi XE4 iOS DataSnap Clients


By Bob Swart

Page 52

Intro to kbmMW connectivity


package 'Spider ' By Fikret Hasovic

Page 57

DUTCH PASCON

LANGUAGES

7 SEPTEMBER 2013

I N T E R N A T I O N A L
PASCAL & DELPHI SESSIONS
CONFERENCE
IN
ENGLISH

Howard Page-Clark, James D. Duff


Trademarks All trademarks used are
acknowledged as the property of their respective
owners.
Caveat Whilst we endeavour to ensure that what is
published in the magazine is correct, we cannot
accept responsibility for any errors or omissions.
If you notice something which may be incorrect,
please contact the Editor and we will publish a
correction where relevant.
Subscriptions ( 2013 prices )
1: Printed version: subscription 65.-(including code, programs and printed magazine,
6 issues per year including postage).
2: Non printed subscription 45.-Incl. VAT 21% (including code, programs and
download magazine)
Subscriptions can be taken out online at

www.blaisepascal.eu
or by written order, or by sending an email to

office@blaisepascal.eu

Advertisers
Barnsten
BetterOffice
Bod Swart
Components 4 Developers
Delphi Developer Days
FastReport
Learn to program using Lazarus
Lazarus the complete guide
Parallel Programming
with Omnithread Library
Smart Mobile Studio

Page
Page
Page
Page
Page
Page
Page
Page

13
45
51
60
3
40
41
56

Page 22
Page 33

Copyright notice
All material published in Blaise Pascal is copyright SOPP Stichting
Ondersteuning Programeertaal Pascal unless otherwise noted and may
not be copied, distributed or republished without written permission.
Authors agree that code associated with their articles will be made
available to subscribers after publication by placing it on the website of
the PGG for download, and that articles and code will be placed on
distributable data storage media. Use of program listings by subscribers
for research and study purposes is allowed, but not for commercial
purposes. Commercial use of program listings and code is prohibited
without the written permission of the author.

COMPONENTS
DEVELOPERS

Subscriptions can start at any date. All issues


published in the calendar year of the subscription will
be sent as well.

Subscriptions run 365 days.


Subscriptions will not be prolonged without notice.
Receipt of payment will be sent by email.
Subscriptions can be paid by sending the payment to:
ABN AMRO Bank Account no. 44 19 60 863
or by credit card: Paypal or TakeTwo
Name: Pro Pascal Foundation-Foundation for
Supporting the Pascal Programming Language
(Stichting Ondersteuning Programeertaal Pascal)
IBAN: NL82 ABNA 0441960863
BIC ABNANL2A VAT no.: 81 42 54 147
(Stichting Programmeertaal Pascal)

Subscription department
Edelstenenbaan 21 / 3402 XA IJsselstein,
The Netherlands / Tel.: + 31 (0) 30 890.66.44 /
Mobile: + 31 (0) 6 21.23.62.68

office@blaisepascal.eu

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Don't Miss! Delphi Developer Days 2013

www.DelphiDeveloperDays.com

Delphi Developer Days 2013


Featuring Bob Swart & Cary Jensen
Bob Swart and Cary Jensen present Delphi Developer Days 2013, a Delphi training tour in the
United State and Europe. Delphi Developer Days is an intense two-day live event where you
will experience both joint sessions, presented by Bob and Cary together, as well as
simultaneous tracks. Some of the topics covered include browser-based clients, essential
through advanced database development, from VCL to FireMonkey, mobile development and
Delphi's NextGen Compiler, data access components, DataSnap, REST versus DBX, XML
and JSON, SOAP, debugging applications, writing Windows services, and gestures and touch
in Delphi applications. There's also an Embarcadero keynote, plus a session by a guest
speaker.

Delphi Developer Days 2013 Dates and Cities


Date

City

Location

30-31 May 2013

Frankfurt, Germany

Holiday Inn Express Frankfurt

3-4 June 2013

Amsterdam, NL

Park Plaza Victoria Amsterdam

Seating is limited to 42 people per city.

Attendees Receive:
An extensive course book (several hundred pages) written by Bob and Cary
that includes material covered in their joint and individual sessions
Source code examples from all of their sessions
A chance to win valuable prizes from our sponsors
Lunch on both days

Register early for an additional discount. Previous attendee and group discounts are available.

Register Now to Reserve Your Space!

www.DelphiDeveloperDays.com
Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Delphi XE4 short overview


Here is a short overview
of what I think is impressive. I am not sure who
had the Idea for all the extras, but Embarcadero
most certainly made quite a job out of it.
There has been put an enormous effort in to XE4
to create samples, help and code views.
We decided to show you some of the internal
extra's that are delivered with the new version.
Just to make you curious.
Now even if you are not experienced with mobile
app development, XE4 will make it very easy to
start some projects that will really teach you how
to and we are quite sure you will be creating your
first ideas and applications very soon.
We also do believe that this will have a far
greater impact on coding AND hardware AND
technological development then we now can see.
It might even turn the future in a new direction.
If youre interested in technology and
development you should read Ray Kurzweil's
book: The Singularity Is Near: When Humans
Transcend Biology. This version of Delphi fits quite
wel into that...
Oh, by the way: it works, but as all code it is not
without errors. But we will see that it is becoming a
fantastic tool.
Your Editor: Detlef

Multi-Device, True Native


Companies are under pressure to deliver apps that their
customers can use in the office and on the road, but coding
and managing these different versions can be costly and
time-consuming.

COMPONENTS
DEVELOPERS

The advantages of multi-device development


Multi-device app development means you don't have to
support multiple development projects to deliver your app
natively on multiple platforms (iOS, Windows, and Mac).
Why is multi-device with RAD Studio the best
development approach?
Most desktop development solutions don't support
mobile app development
Most mobile development solutions do not support the
creation of PC apps for Windows and Mac
As a result, development teams not using RAD Studio
often have to support multiple development projects
using different tools, programming languages, code
bases, and sometimes different teams to deliver their
app on both desktop and mobile devices

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Delphi XE4 short overview (Continuation 1)


Building your app in RAD Studio eliminates the need to
engage in multiple development efforts for the same
application on multiple devices. This means you get to
market faster, on more platforms for the first release
and every release after that while keeping costs down.
What are "true native" apps, and why should you care?
True native app development lets you deliver script-free,
device-native apps that expose the full range of
capabilities and performance in the underlying devices
for faster, richer apps that end users love.
Many tool vendors are using the term "native" app
development to describe web technologies and scripts
wrapped into an app package to deliver an app-like user
experience. This approach can impose limits on app
performance and capabilities.
How do true native apps built with RAD Studio differ from
what others might call "native"?
True native apps in RAD Studio are script-free and run
directly on hardware CPU delivering the following
advantages:
Fast Uncompromised native device performance with
full native API and CPU control when you need it, and
not limited by or slowed by script interpreters and
virtual machines.
Predictable Apps run directly on the device CPU,
as intended by the device vendors, and are not slowed
by additional software layers and processes, such as
random garbage collection.
Better User Experience (UX) Apps take full advantage
of device capabilities and performance.
RAD Studio is the app development suite for companies
that need to create true native apps for PCs, tablets, and
smartphones and get them to market fast.

iOS user interface controls


With Delphi in RAD Studio XE4, you get a full range of
native styled user interface controls, including buttons,
listboxes and combo boxes, to incorporate into your apps.
The iOS apps you create include native controls like the
date picker and custom picker, different keyboard types,
services like notifications, and support for Share Sheet to
print and share via social media, email and direct
communication with other apps. Learn more >

Rapid prototyping
RAD Studio XE4 delivers an enhanced and optimized
developer workflow for mobile development that
automates deployment and debugging on both the
simulator and device. Rapidly prototype your apps with
layouts for each device type and quickly go from
prototype to production. Integrate feedback quickly by
deploying your prototype directly onto your target device
using actual framework objects and code. Learn more >

Multi-device, true native app development


RAD Studio's multi-device app development solution
means you don't have to support multiple development
projects to deliver your apps natively on multiple
platforms (iOS, Windows and Mac OS X). RAD Studio XE4
makes it easy to build script-free true native apps for
multiple devices that expose the full range of capabilities
and performance in the underlying devices.

Develop apps for iPhone and iPad


Create mobile apps using the programming skills,
knowledge and code that you already have. Your RAD
Studio Delphi iOS apps will have fast native performance
and better security than web-based or scripting language
based apps. Use a full visual designer for iOS user
interfaces with multiple device types, resolutions, and
orientations.

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

COMPONENTS
DEVELOPERS

Delphi XE4 short overview (Continuation 2)


IBLite and SQLite iOS database support
RAD Studio XE4 includes iOS local database support for
SQLite and embedded InterBase via dbExpress, FireDAC
and IBX. You also get a free development and free
unlimited deployment license for IBLite for iOS a new
edition of the popular embedded InterBase ToGo
database. Learn more >

Blank Application - with no preset components


3D Application - with no preset components
Header/Footer
Header/Footer with Navigation
Tabbed
Tabbed with Navigation
Phone Master-Detail
Tablet Master-Detail

You can use one of the mobile application templates as


your starting point when you create a new application. A
template is a predefined mobile application, a project that
contains forms that are preconfigured with components.
For more information, see FireMonkey Mobile Application
Templates.
FireMonkey Mobile Form is a new wizard for creating a
FireMonkey mobile form.

iOS Target Platforms Supported


The iOS mobile target platforms are now represented in
the Target Platforms node of the Project Manager.
When you create a FireMonkey Mobile Application, there
are two basic iOS target platforms that you can select
(iOS Simulator and iOS Device).

Multi-tier client support for DataSnap, web services


and enterprise databases
RAD Studio XE4 includes ISV and enterprise-class
integrated database connectivity, middleware and cloud
computing via dbExpress and FireMonkey. You get
integrated support for SQL Server, Oracle, Sybase, DB2,
InterBase, SQL Anywhere, SQLite, MySQL, and many
more embedded and server databases as well as cloud
services including Windows Azure and Amazon Web
Services.

As the target platform for the next build, you can select:
iOS Device (for an iOS device connected to your Mac),
which is any of the following:
Debug (for development cycles)
Ad-hoc (for private distribution)
App Store (for submitting your app to the App Store)
iOS Simulator (for the iOS simulator running on
Mac OS X; the default iOS app),
which is any of the following:
iPad
iPhone (the default)
iPhone 5
You can add iOS Device and iOS Simulator to your custom
run-time packages, and build them for those platforms, so
your components can be used in those platforms as well.

Access more databases, on more devices, more


easily with FireDAC
FireDAC gives you native high-speed direct access from
Delphi and C++Builder to InterBase, SQLite, MySQL, SQL
Server, Oracle, PostgreSQL, DB2, SQL Anywhere,
Advantage DB, Firebird, Access, Informix, DataSnap and
many more local/embedded, mobile and enterprise
databases. Easily migrate from BDE and other
technologies.
FireMonkey FM3 Application Platform
RAD Studio XE4 leverages FireMonkey FM3, the next
generation platform for building multi-device, true native
apps from a single C++ or Delphi codebase. You code
once and the framework takes care of optimizing your app
for multiple target platforms. Visual components give you
extendable and reusable building blocks for faster and
highly maintainable development. Learn more >

IDE Changes for XE4


New FireMonkey Mobile Wizard
FireMonkey Mobile Application:
When you select File > New > FireMonkey Mobile
Application - Delphi, the FireMonkey Mobile Application
wizard opens, and you are prompted to select one of the
following FireMonkey Mobile Application types:

COMPONENTS
DEVELOPERS

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Delphi XE4 short overview (Continuation 3)


Overview of Building samples:

In the pdf:
click to see
the video

In the pdf:
click to see
the video

In the pdf:
click to see
the video

iOS Location

iOS Web Browser

iOS DatePicker

This code snippet (available inside the


Delphi IDE) shows you how to use the
TLocationSensor component in order
to read the GPS location of the device
and display it realtime on the form.
The snippet also shows you how to
display Google Maps in a web browser
in order to accurately pinpoint the
location of the device on a real map.

This code snippet(available inside


the Delphi IDE) shows you how to
use a TWebBrowser component on
an iOS device. The application
consists of an edit box, a button and
the web browser component. Type
an address in the edit box and press
the "GO" button in order to redirect
the browser to your address.

This code snippet(available inside the


Delphi IDE) shows you how to use the
TCalendarEdit component in order to
pick dates from it and process them to
use in your own applications.

In the pdf:
click to see
the video

In the pdf:
click to see
the video

In the pdf:
click to see
the video

iOS Share Sheet

iOS AudioRecPlay

This snippet (available inside the Delphi


IDE) shows you how to use standard
actions to open the Camera Application
on your iOS device to take a photo and
display it on your FireMonkey form.
Then, with another standard action,
you will open the Share Sheet to share
your image via email, post to Facebook
and Twitter, print via AirPrint and more.

This code snippet (available inside


the Delphi IDE) shows you how to
record some sound via the
microphone and then playback using
the device speakers or headphones.

This code snippet (available inside the


Delphi IDE) shows you how to rotate
an image on an iOS device

In the pdf:
click to see
the video

In the pdf:
click to see
the video

In the pdf:
click to see
the video

iOS Interactive Gestures


- Image Zoom

iOS Interactive Gestures


- Image Rotation

iOS Interactive Gestures


- Tap and Hold

This code snippet (available inside the This code snippet (available inside
Delphi IDE) shows you how to pinch
the Delphi IDE) shows you how to
and zoom an image on an iOS device. use tap and hold to display a
message

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

iOS SendCancelNotifications
This code snippet (available inside the
Delphi IDE) you how to use the
Notification API in order to send a
notification immediately or with a 10
second delay and how to cancel a
scheduled notification or all notifications.

COMPONENTS
DEVELOPERS

Delphi XE4 short overview (Continuation 4)


Overview of Building samples:

In the pdf:
click to see
the video

iOS Accelerometer

iOS Gyroscope

iOS Location

This snippet (available inside the


Delphi IDE) shows you how to use
the accelerometer in order to obtain
information about the acceleration,
angular acceleration, motion and
speed.

This snippet (available inside the


Delphi IDE) shows you how to use the
Gyroscope in order to rotate a 3D
cube when the iOS device is tilted.

This code snippet (available inside the


Delphi IDE) shows you how to use the
TLocationSensor component in order to
read the GPS location of the device and
display it realtime on the form. The
snippet also shows you how to display
Google Maps in a web browser in order to
accurately pinpoint the location of the
device on a real map.

iOS OrientationSensor

iOS DeviceInfo

iOS MessageAlerts

This code snippet (available inside the This code snippet (available inside the
Delphi IDE) shows you how to use the Delphi IDE) shows you how to use
TOrientationSensor component in order obtain device information that
includes OS version, OS name, and
to get various compass related
device type.
information such as three axis tilt,
distance and heading, heading relative
to magnetic north compensated and
uncompensated and heading relative
to true north compensated and

This application (available inside the


Delphi IDE) shows how to pop-up
various alert messages both standard
one button information box style, and
multiple button input box styles that
allows various confirmations.

In the pdf:
click to see
the video

iOS ShareSheet

iOS
Notifications
(Set/Reset
Badge Number)
This code snippet (available inside the
Delphi IDE) shows you how to use the
Notification API in order to set the
badge number on the application icon
to a specified value or to reset the
badge number to 0.

COMPONENTS
DEVELOPERS

iOS PhoneDialer
This application (available inside the
Delphi IDE) shows how to use the
PhoneDialer API in order to make a
phone call and to obtain the carrier

This snippet
(available inside
the Delphi IDE)
shows you how to
use standard
actions to open the
Camera Application
on your
iOS device to take a photo and display it
on your FireMonkey form. Then, with
another standard action, you will open
the Share Sheet to share your image via
email, post to Facebook and Twitter, print
via AirPrint and more.

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Delphi XE4 short overview (Continuation 5)


Overview of Building samples:

In the pdf:
click to see
the video

iOS Interactive Gestures


- Image Rotation

iOS TabSliding

iOS SQLite

iOS CustomPicker

This snippet (available inside the


Delphi IDE) shows you how to use a
This set of code snippets (available
TabControl with TabPosition set to
inside the Delphi IDE) shows you how
tpDots in order to enable scrolling of
to rotate an image on an iOS device. .
tab items on iOS devices. The
Application has 2 tab items each one
containing a different image.

This snippet (available inside the


Delphi IDE) shows you how to
populate a list box from a SQLite
database using LiveBindings.

iOS IBLite
This snippet (available inside the Delphi
IDE) shows you how to populate a
listview from an IBLite database using
LiveBindings.
To deploy this snippet you need to use
the IBLite license, following the
instructions that were emailed along
with the RAD Studio license (or trial
license).

iOS HorizontalScroll

This code snippet (available inside the


Delphi IDE) shows you how to use the
TComboBox component in order to
pick an item from it and display its
Text on a label.

This snippet shows (available inside


the Delphi IDE) you how to use the
THorzScrollBox component in order to
scroll through two identical pictures.

iOS CameraComponent

iOS CameraRoll

iOS
AccessCamera
App
This snippet shows (available inside
the Delphi IDE) you how to use
standard actions in order to open the
Camera Application on your iOS
device, take a picture and retrieve the
taken image for displaying on your
FireMonkey form.

Nr 2 / 2013 BLAISE PASCAL

This code snippet (available inside the This snippet shows (available inside
the Delphi IDE) you how to use
Delphi IDE) shows you how to
standard actions in order to open the
manipulate the Camera on your iOS
Photo Library on your iOS device and
device. The snippet allows you to
retrieve an image from the library for
select either the front facing camera
displaying on your FireMonkey form.
or the back facing camera. Also you
can select whether to use the flash
(always on or automatic) or not.
COMPONENTS
MAGAZINE

DEVELOPERS

Delphi XE4 short overview (Continuation 6)


Overview of Building samples:

In the pdf:
click to see
the video

iOS SendCancelNotifications

iOS DatePicker

This code snippets (available inside


the Delphi IDE) shows you how to use
the Notification API in order to send a
notification immediately or with a 10
second delay and how to cancel a
scheduled notification or all

This code snippet (available inside the


Delphi IDE) shows you how to use the
TCalendarEdit component in order to
pick dates from it and process them to
use in your own applications.

In the pdf:
click to see
the video

iOS Interactive Gestures


- Tap and Hold
This set of code snippets (available
inside the Delphi IDE) shows you how
to use tap and hold to display a
message.

In the pdf:
click to see
the video

iOS Interactive Gestures


- Image Zoom
This set of code snippets (available
inside the Delphi IDE) shows you how
to pinch and zoom an image on an iOS
device.

In the pdf:
click to see
the video

In the pdf:
click to see
the video

iOS AudioRecPlay

iOS Web Browser

This code snippet shows (available


inside the Delphi IDE) you how to
record some sound via the
microphone and then playback using
the device speakers or headphones.

This code snippet shows (available


inside the Delphi IDE) you how to use
a WebBrowser component on an iOS
device. The application consists of an
edit box, a button and the web
browser component. Type an address
in the edit box and press the "GO"
button in order to redirect the browser
to your address.

iOS PlayAudioFile
This code snippet shows (available
inside the Delphi IDE) you how to
include an audio file for playback in
your iOS application.

10

COMPONENTS
DEVELOPERS

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Delphi XE4 short overview (Continuation 7)

NEW AND ENHANCED


FEATURES IN DELPHI XE4

Archit.

Ultim.

Enterpr Profess. Starter

INTEGRATED COMPILERS AND TOOLCHAINS


Delphi command line toolchains
for iOS (dccios32, dcciosarm)
X
X
X
Delphi iOS ARM Compiler
and Delphi iOS Compiler for iOS Simulator
X
X
X
APPLICATION PLATFORMS, INTEGRATED FRAMEWORKS, DESIGNERS AND SDKS
Enhanced in XE4! FireMonkey platform for creating
OS X 10.7 and 10.8 applications
X
X
X
FireMonkey platform for creating native
iOS applications for iOS 5.1 and 6.x
X
X
X
FIREMONKEY (FM2)
Native message alerts for iOS
X
X
X
Custom Pickers for both iPhone and iPad
X
X
X
Date Picker for both iPhone and iPad
X
X
X
Phone Dialer Support for iOS
X
X
X
Built-in text editing mode for TEdit and
TMemo controls on iOS, including Cut/Copy/Paste/Zoom
X
X
X
Notification center on iOS
X
X
X
Gesture support for iOS, including swipe (pan), tap, tap and hold,
double tap and pinch & zoom
X
X
X
Native iOS application styling for iPhone
and iPad (Retina and non-Retina) on iOS 5.1 and 6.x
X
X
X
FireMonkey Mobile Application Wizard
with header/footer, tabbed, and master detail templates
X
X
X
Full set of native iOS styling options
for buttons, toolbars, listboxes, sliders, switch controls
X
X
X
Mobile Form Layout Tools: design
for landscape/portrait/upside down landscape and
upside down portrait layouts
X
X
X
Support for multiple form factors:
choose from iPhone/iPhone 5/iPad or add a custom device X
X
X
Mobile Status Bar:
toggle form property to show/hide status bar
X
X
X
Web Browser for loading
and displaying web content in your iOS applications
X
X
X
Enhanced in XE4! Extended ListBox capabilities for iOS,
including header/footer/grouped styling, embedded search
and expanded LiveBindings support
X
X
X
Support for various keyboard types on iOS
X
X
X
TMagnifier component for easily zooming in
on images and text
X
X
X
TCamera component for accessing the front
and back camera, flash etc.
X
X
X
TabControl with new settings for using tabs as views
X
X
X
FireMonkey Frames
X
X
X
Toggle Device Skin to show/hide
mobile device background
X
X
X
iOS Sample Applications for using
the new sensors and services
X
X
X
Mac OS X Full screen Mode
X
X
X
Action for accessing
the camera application on iOS
X
X
X
Action for accessing images
from the camera roll on iOS
X
X
X
Share Sheet support on iOS 6 for
sharing content via Messaging, Mail, Facebook, Twitter etc. X
X
X
Slide transition action for TTabControl
Enhanced XE4! Location Services component
for GPS or triangulation
X
X
X
Orientation sensor (gyroscope/compass)
on iOS
X
X
X
Orientation sensor (gyroscope/compass) on Windows
X
X
X
Enhanced in XE4! Motion Sensor component
for accelerometer access on iOS
X
X
X
Enhanced in XE4! Motion Sensor component
for accelerometer access on Windows
X
X
X
X
X
X
Enhanced in XE4! FireMonkey performance optimizations

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Optional
Optional

X
Optional
Optional
Optional
Optional
Optional
Optional
Optional
Optional
Optional
Optional
Optional

Optional
Optional
Optional
Optional

Optional
Optional
X

X
X
X

X
X
X

Optional
Optional
X
Optional
Optional
Optional

Optional
X

Optional
X
X

X
X

Delphi XE4 short overview (Continuation 8)

NEW AND ENHANCED


FEATURES IN DELPHI XE4

Archit.

Ultim.

Enterpr Profess. Starter

INTEGRATED BUILD TOOLS AND PROJECT SUPPORT


FireMonkey application wizards
X
X
X
Deploy apps to the iOS Simulator (iPhone/iPhone 5/iPad)
X
X
X
Define info.plist application
settings including supported orientations in the IDE
X
X
X
Deploy apps to the iOS Device
(Debug/Ad Hoc/ App Store)
X
X
X
Define application splash screens
and app icons in the IDE
X
X
X
Enhanced in XE4! Platform Assistant for deploying
and debugging across platforms
X
X
X
Enhanced in XE4! Delphi 1 through XE3 project import
X
X
X
LANGUAGE AND RUNTIME LIBRARY FEATURES
Automatic Reference Counting in iOS ARM compiler
X
X
X
Optimized, 0-based,
immutable Unicode strings in iOS ARM compiler
X
X
X
Delphi RTL for iOS
X
X
X
PERSONAL DEVELOPER PRODUCTIVITY
Deployment Manager: Deploy to iOS
X
X
X
INTEGRATED DEBUGGING
Remote iOS Simulator Debugging
X
X
X
Remote iOS Device Debugging
X
X
X
INTEGRATED UNIT TESTING
Enhanced in XE4! Continually updated help system with diagrams
X
X
showing class hierarchy, and new declared members pages X
DATABASE APPLICATION DEVELOPMENT AND CONNECTIVITY DBEXPRESS
SQLite dbExpress client support for iOS
X
X
X
InterBase Express (IBX) for iOS
X
X
X
DataSnap Mobile Connector support
X
X
X
for latest versions of iOS, Android and BlackBerry
X
X
X
InterBase ToGo dbExpress driver for iOS
FIREDAC MULTI-DEVICE DATA ACCESS LIBRARY
Data Access components for Win/Mac
X
X
X
Data Access components for iOS
X
X
X
Windows/Mac enterprise database support,
including MySQL, Microsoft SQL Server, Oracle Database,
InterBase, PostgreSQL, Sybase SQL Anywhere, Microsoft
Access, IBM DB2 Server, Firebird, Advantage Database
X
X
X
Mobile database support, including SQLite
and InterBase IBLite
X
X
X
Comprehensive support for SQLite v3+
database, including "smart" data type recognition
X
X
X
Easy to use TDataSet descendant classes
X
X
X
Unified Data Access API
X
X
X
Comprehensive support for InterBase v6+,
including multiple transactions
X
X
X
FireDAC clients for DataSnap
X
X
X
High-performance in-memory dataset
X
X
X
FireDAC source code
X
X
X
Easy to use TADMemTable - in-memory dataset,
highly compatible with TClientDataSet
X
X
X
DataSnap client support for HTTP, HTTPS
and TCP/IP protocols and authentication
X
X
X
Local SQL with heterogeneous SQL commands
to TDataSet's,full SQLite SQL dialect support,
add-hoc TDataSet lookup
X
X
X
DATASNAP MULTI-TIER
New in XE4! TClientDataSet support for iOS
X
X
X
New in XE4! DataSnap clients for iOS
X
X
X
DATASNAP MOBILE CLIENT CONNECTORS
Enhanced in XE4! Apple iOS
X
X
X
(iPhone, iPad, iPod Touch) 5.1 and 6.x
INCLUDED DATABASES
IBLite for iOS
with unlimited deployment license
X
X
X

10

X
Optional

Optional
Optional
Optional
X
X

Optional
Optional
Optional
Optional
Optional
Optional

Optional
Optional

Optional
Optional
Optional

Optional
Optional
Optional
Optional
Optional
Optional
Optional
Optional
Optional
Optional
Optional

Optional

Optional1

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Delphi XE4 short overview (Continuation 9)

NEW AND ENHANCED


FEATURES IN DELPHI XE4
ADDITIONAL COMPONENTS AND TOOLS
SOAP Clients for iOS
INTERNET DIRECT (INDY)
Indy for iOS
VISUAL COMPONENT LIBRARY (VCL)
Enhanced in XE4! Interactive multi-touch gestures
for pan, zoom, rotate, tap, double tap, tap and hold
(requires multi-touch enabled OS)
DATABASE MODELING AND DESIGN
Updated in XE4! Embarcadero
ER/Studio 9.5 Developer Edition, a database modeling
and design tool for better understanding
database structures
LICENSING AND TOOL MANAGEABILITY
Enhanced in XE4! Earlier version licenses included
in AppWave network licenses (Delphi 2007- XE3).
Delphi 7 available separately
Enhanced in XE4! Access to licenses and downloads
for earlier versions with purchase of
standalone product licenses (Delphi 2007 XE3, Delphi 7)

Archit.

Ultim.

Enterpr Profess. Starter

Optional

Optional

Requires purchase of Mobile Add-On Pack for Professional


Requires purchase of FireDAC Client/Server Pack for Professional
Requires purchase of Mobile Add-On Pack for Professional for use with mobile apps. Requires purchase of
FireDAC Client/Server Pack for Professional for use in Windows and Mac apps.

Adopting a new software version is always a challenge.


What's new? How does it work?
What are the improvements?
How do I??? etc.
That's why we want to add instant value if you move up to XE4.
Please check our exclusive time limited offer for Blaise readers
on our site via http://www.barnsten.com/smashing-deal
So ACT NOW and start building your Windows, Mac
and Mobile iOS Apps!

http://www.barnsten.com/smashing-deal
Nr 2 / 2013 BLAISE PASCAL MAGAZINE

13

Alternative datastreams:

By Jean Pierre Hoefnagels

a little known Windows feature


> Most programs need to store data on
disk. Properties such as checkbox
settings, log-in names, in fact anything
you want the program to remember when it
restarts.
Normally you would use the registry or
an INI file to do this. INI files are
designed specifically for this, and they
are fine for text fields, radio buttons
etc. when it does not cause a problem
that users can manually alter the data.
However there are times when you dont
want a user to do this. Typing errors
might give trouble when reading the
file, or some settings might depend on
other settings and their interrelationship becomes corrupted these
are typical scenarios you want to avoid.
Sometimes it makes sense to store data
in non-text files as binary or cached
data. Your exe folder can soon look
messy if you do this. Auto creating
subdirectories helps, but if the user
has no business editing those files, why
allow him to open them?

procedure TfrmADSExample.FormCreate(Sender: TObject);


begin
IniFileName :=
ChangeFileExt(paramstr(0),'.ini');
AppIni:=
TInifile.Create(IniFileName);
..
end;

Windows has a little known feature that solves all of this:


ADS.
It is available since Windows NT3.1 and works by storing a
file on disc that is not a normal file, but is embedded into
another (normal) file. This only works on the NTFS file
system. Media that use the FAT file system will NOT
support this. The content of the visible file remains
unaltered, and the file size and date remain untouched.
Copying or moving the visible file also copies the content
of the attached files. When the visible file is deleted, the
attached hidden files are also deleted.
One very useful application of this file scheme is adding a
very small hidden file to an Exe with just its CRC and size.
The exe itself will not change, but a program that knows
about these ADS files can check the file CRC and size...
For a Delphi programmer it is not very useful to attach
ADS files to the exe file. Each time the Delphi application is
recompiled then exe file is overwritten and all attached
ADS files are deleted. Any other file is better, but one file
type is best: the INI file. INI files are normal for any exe,
and more importantly, their name corresponds to the exe,
and is not replaced when you recompile.
An inifile already stores common settings between
program runs, so it is a logical choice to store hidden data
in there too
Let's create a simple Form that automatically creates and
uses its own INI file. First we need to include the unit
inifiles in the uses section. Then we add a variable of the
type TIniFile to the form, and a string variable that holds
the name of the INI file.
private
IniFileName : string;
AppIni : TInifile;
public

Everything you create must also be freed when no longer


needed. The freeandnil() also writes data that is still in
memory to the INI file on disc and closes the ini file. In
FormDestroy() we put this line of code:
procedure TfrmADSExample.FormDestroy(Sender:TObject);
begin

..
freeandnil(AppIni);
end;

Thats all you need to start using inifiles, but how do you
use them? That too is surprisingly simple.
The TInifile class has lots of methods to read or write data.
An example: we place an edit box named edUser on the
form for a user name, but we do not want to fill it in every
time the program is started..
In the FormDestroy (or OnChange of the edit box) we save
the user name into the inifile :
procedure TfrmADSExample.FormDestroy(Sender: TObject);
begin

..
AppIni.WriteString('MainForm', 'edUser',
edUser.Text);
FreeAndNil(AppIni);
end;

This part takes care of storing the data, but without loading
it back that is not very useful. Loading can be done in
many ways like for instance overriding the Loaded()
method of the form.
To keep this example as simple as possible we assign an
event handler to the form's OnActivate event.
procedure TfrmADSExample.FormActivate(Sender: TObject);
begin
edUser.Text := AppIni.ReadString(
'MainForm', 'edUser', '');
end;

This loads the data into the edit box when the form is
activated. Of course the TInifile class can do a lot more,
please check the help if you want to know more about this.
There are lots of moments data can be stored and loaded,
this is just an example.
For now we do not even use the inifile as an inifile to store
settings data; we only created it as a carrier for ADS files.
ADS files can be addressed by using any normal file name
followed by a colon and another name.
Example: MyApplication.ini:cache1.bin.
We add another string variable ADSFileName to the
form that is initialized in the FormCreate.
procedure TfrmADSExample.FormCreate(Sender: TObject);

In the FormCreate we initialize the file name to a name that begin


IniFileName := ChangeFileExt(paramstr(0),'.ini');
is equal to the exe, but with the .INI file extension. It has
AppIni
:= TInifile.Create(IniFileName);
the same file path and name as the application, and will
ADSFileName := IniFileName+':'+'hidden.txt';
end;
appear in the same directory. Next we create the inifile
object AppIni.

14

COMPONENTS
DEVELOPERS

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

First Look at FireDAC By Cary Jensen


starter

expert

Delphi XE4 and later

I'm a database guy, which you've probably figured


out if you are a regular reader of Blaise Pascal.
Way back in the 1980's I was building multi-user
databases for local area networks using Paradox.
When Delphi shipped it immediately became my
development tool of choice. And although some of
those early applications used the Paradox file
format, due to my client's specifications, almost
everything I do these days involves a remote
database server.
Until recently, Delphi's out-of-the-box support for
client/server development was less than perfect.
SQL Links for Windows, the Borland Database
Engine's (BDE) support for client/server, was
deprecated more than a decade ago. It's
replacement, dbExpress, failed to live up to
expectations, leaving many Delphi developers
turning to alternative sources for quality TDataSet
descendents for their data connectivity.
But things have changed in this "Marco Cant" era of
Delphi. In February, Embarcadero announced that it had
acquired AnyDAC from DA-Soft, and that AnyDAC
architect Dmitry Arefiev was staying on to bring his
substantial talents to the Delphi team.
All of a sudden the game has changed. Not only does
Delphi have a new data access component library, it has a
world-class data access component library that lives up to
the high expectations of Delphi developers.
Those of you who used AnyDAC, newly christened
FireDAC, are familiar with the many features and benefits
of this powerful set of components. This article is not
intended for you. Instead, this article is designed to
introduce Delphi developers unfamiliar with FireDAC to
this new data access mechanism.
A Complete TDataSet Implementation
To begin with, FireDAC's data access components are true
TDataSet descendants, just as are TSQLDataSet and
TSQLQuery from dbExpress and TTable and TQuery from
the BDE. However, unlike the dbExpress TDataSets,
FireDAC TDataSets support the full breadth of the
TDataSet interface.

16

COMPONENTS
DEVELOPERS

TSQLDataSet, while being a TDataSet descendant, includes


many methods and properties you cannot not use without
raising exceptions. These include Edit, Prior,
AppendRecord, and many others associated with editing
and navigation. In fact, it is not even possible to hook an
active TSQLDataSet or a TSQLQuery to a DBGrid through
a TDataSource. Attempting to do so raises an exception.
FireDAC components, however, support all of the TDataSet
methods, and can be wired to VCL data-aware controls as
well as to BindSourceDB components for use with
LiveBindings. In short, FireDAC TDataSets support the full
set of methods and properties original found in BDE
TDataSets, including cached updates. (Even the BDE
stopped supporting cached updates beginning with Delphi
6. This was not intentional, however. It's just that cached
updates broke in that version and were never fixed).
FireDAC TDataSets go even further. FireDAC's TDataSets
support a number of features previously only found in the
TClientDataSet. These include Aggregates, GroupingLevel,
and GetGroupState. And it does this all while supporting
all platforms supported by Delphi, which currently
includes 32-bit and 64-bit Windows, Mac OSX, and iOS.
A Real Replacement for
the Borland Database Engine
For years now Embarcadero has been admonishing
developers to migrate their applications from the BDE to
dbExpress. To be honest, dbExpress was never an acceptable
BDE replacement. The closest thing to a true BDE
replacement that I was familiar with was the Delphi Data
Access Components for the Advantage Database Server. You
really could convert your TTables to TAdsTables and
provide you users essentially the same experience. The
drawback, however, was that you had to convert your data
from Paradox or dBase to the proprietary Advantage format,
or less preferably, to FoxPro, Visual FoxPro, or Clipper.
FireDAC's TADTable provides the same navigational
support found in TTable, and does so across all of its
supported file formats. If you want to stick with Paradox
tables (not the most stable of formats due to its file server
nature), you can do so using FireDAC's support for ODBC.

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Writing UI-Independent Code


with Anonymous Methods
starter

expert

Delphi XE4 and later

With the advent of the new Delphi iOS compiler, you


often have the need of having a different user
interface for an application you already have working
on Windows, maybe on the Mac. A few years ago, I
had a simple Twitter search client written in a VCL
application and wanted to move it to FireMonkey to
recompile on the Mac. Recently, I took the same
application and easily made an iOS version, with a
different user interface (UI). The technique?
Separate the application logic from UI-related code
by using anonymous methods.
On Anonymous Methods
In case you don't know, an anonymous method or
closure (this is how they are called in other
programming languages) is more or less like a
function you can pass as parameter. However,
different from traditional functions (or methods, like
event handlers) passed as parameters, an
anonymous method has a peculiarity: It can refer to
the data structure available in the code where it is
declared, even if those structure aren't (apparently)
accessible when the code is executed. In other
words, an anonymous method captures its execution
context and changes the scope and the lifetime of
some data structure.

Separating UI
In the specific scenario, the application retrieves an XML
data structure. I could have passed that data structure to
the user interface processing code, populating the visual
controls. In this way, however, the code used to parse the
XML would have been written multiple times.
The anonymous method in question, instead, receives
as parameter an individual XML node, from which it can
extract the information for the user interface.
I guess things will be clearer as we start looking to the
actual code.
Here comes a Data Module
The first version I wrote was a little different from what
I'm showing here, but after some refactoring to make it
more portable became the following.
At the core of the family of programs there is a data
module with two components:
object IdHTTP1: TIdHTTP
HandleRedirects = True

object XMLDocument1: TXMLDocument


DOMVendorDesc = 'ADOM XML v4'
end

The first is an Indy HTTP client component, with redirect


support enabled; the second is an XMLDocument
component, based on the ADOM native Pascal XML DOM,
the only one portable across all of the platforms Delphi
supports.
In the same data module, there is a code method called
GetData and receiving as parameters the string to search
for an an anonymous methods to be used to process each
entry:

COMPONENTS
DEVELOPERS

procedure TTweetsDataModule.GetData(
const strTopic: string;
processEntry: TProcessEntry);

The anonymous method type is declared as follows:


type
TProcessEntry =
reference to procedure
(iEntry: IXMLEntryType);

As you can see the parameter is an XML node based on the


interfaces for the individual entry in the response.
This interface has been obtained by using the XML
Data Binding Wizard on a sample structure returned
by a search on twitter and simplifies interacting
with the XML data.
Now, with this information in mind, you can look at the
complete source code of the GetData methods in Listing 1.
In the code you can see the HTTP call to search on Twitter,
how the resulting XML is loaded in the DOM, mapped to
the interfaces, and how the anonymous method is invoked
for each entry in the resulting data structure
Listing 1:
The GetData method of the (shared) data module
procedure TTweetsDataModule.GetData(
const strTopic: string; processEntry:
TProcessEntry);
var
strResult: string;
feed: IXMLFeedType;
I: Integer;
begin

// get the data from twitter


strResult :=
IdHTTP1.Get('http://search.twitter.com/search.ato
m?q=' +
strTopic + '&rpp=30&page=1');
XMLDocument1.LoadFromXML(strResult);
XMLDocument1.Active := True;

// now process the info


feed := Getfeed (XMLDocument1);
for I := 0 to feed.Entry.Count - 1 do
begin
processEntry (feed.Entry[I]);
end;
end;

end

18

By Marco Cant

VCL was first


The first application I had up and running with this
approach was a very classic VCL application, based on a
ListView component.
In this case (like in all following ones) you can enter the
search term in an edit box, and pass this value plus the
anonymous method to fill the UI to the GetData method
of the data module shows above.
The complete code is in Listing 2

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

CONFERENCE IN ENGLISH

DUTCH

PASCON

UTRECHT - NETHERLANDS

I N T E R N A T I O N A L
PASCAL & DELPHI SESSIONS
RAY KONOPKA - RAIZE COMPONENTS / DMITRY AREFIEV - FIREDAC
BRUNO FIERENS - TMS SOFTWARE / BOB SWART TRAINING & CONSULTANCY
RAYMOND HORSTEN - ER/STUDIO / DANNY WIND - THE DELPHI COMPANY
GIRISH PATIL - PDF COMPONENTS - GNOSTICE
KIM MADSEN - COMPONENTS4DEVELOPERS
GWAN TAN - BETTER OFFICE - JEROEN PLUIMERS
MATTHIAS GRTNER - LAZARUS / JOOST VAN DER SLUIS - LAZARUS IOS
MICHAEL PHILIPPENKO - FASTREPORT / MICHAEL VAN CANNEYT - FREE PASCAL
DANNY WIND - THE DELPHI COMPANY / MARIO VERMEULEN - 3D OFFICE

SEPTEMBER 7 2013

BLAISE PASCAL MAGAZINE &

Introduction to Databases Part 12: A DataSnap Client


By Cary Jensen
starter

expert Delphi XE4 and above

In the preceding article in this series I discussed a DataSnap server that implemented authorization
and authentication. In addition, that server employed filters for encryption. In this article I introduce
a Delphi client that communicates with that DataSnap server.
Before I continue, however, I want to clarify a term that I have been using in this series. I have
repeatedly referred to the type of DataSnap server that I described in the past two articles in this
series as IP-based DataSnap servers.
While it is true that this type of server use TCP (Transmission Control Protocol) over IP (Internet
Protocol), it has been brought to my attention that Embarcadero's documentation refers to these
types of servers as DBX DataSnap servers.
The original DataSnap server used COM (Component Object Model) to communicate, and the
new style, introduced in Delphi 2009, uses TCP/IP. Since the COM style of DataSnap server is limited
to Windows installations, and should generally be considered deprecated (though Embarcadero has
not officially deprecated COM-based DataSnap servers), from this point on I am going to refer to IPbased DBX DataSnap servers simple as DBX DataSnap servers.

Connecting to a DBX DataSnap Server


Connecting to a DBX DataSnap server from a Delphi client requires two components. One of these is
SQLConnection, the component that you use to access database servers using dbExpress drivers. The
second is DSProviderConnection, and it takes responsibility for enumerating the DataSetProviders
exposed by the server.
That DBX DataSnap clients communicate to their servers using a dbExpress driver introduces
some interesting configuration options. Specifically, you can either configure the connection to the
DataSnap server using the DriverName and Params properties of the SQLConnection component, or
you can create a reusable DataSnap connection with Delphi's Data Explorer.
The following description describes how to create a reusable connection in the Data Explorer.
Unfortunately, these steps cannot be completed with the DataSnap server I described in the preceding
article in this series (with a successful connection test) since the Data Explorer does not support the
encryption filters used by that server.
If you are not using filters for encryption or compression you start by ensuring that the DataSnap
server for which you are configuring this connection is running. If your DataSnap server is a VCL
Forms application, and you are running Windows Vista or Windows 7 (or later), you might have to run
your DataSnap server with administrative privileges.
Next, open the Data Explorer, shown in Figure 1. By default, the Data Explorer is available as a tab
in the same pane as the Project Manager. If you do not see this tab, you can click the right arrow at the
lower right corner of this pane until you see the Data Explorer tab, after which you should click this
tab. Alternatively, you can select View | Data Explorer from Delphi's main menu to display the Data
Explorer.
If you expand the DATASNAP node of the
Data Explorer, you should find an existing
connection named
DATASNAPCONNECTION. If you want,
you can modify this connection. In most
cases, however, you will want to create a
new DataSnap connection. To do this,
right-click the DataSnap node and select
Add New Connection to display the Add
New Connection dialog box shown in
Figure 2.

Figure 1. The Data Explorer

Make sure that Provider Name is set to DATASNAP, and enter


the name of your connection in the Connection Name field. In
the preceding image, the name IPDataSnapServer has been
entered. Click OK when you are done.
You are ready to configure your new connection. Expand the
DATASNAP node in the Data Explorer, right click
IPDataSnapServer, and select Modify Connection (Figure 3).

Figure 2. The Add New Connection dialog box

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

COMPONENTS
DEVELOPERS

23

smartmobilestudio.com

Programming in Smart: Refactoring By Primo Gabrijeli


A quick reminder: In this series we are looking into the
world of mobile/browser programming in Object Pascal
with the Smart Mobile Studio
(www.smartmobilestudio.com). In the previous two
instalments (published in issues 25 and 26) we have put
together a small (and very stupid) To-do application.
This time we'll adapt it to Smart 1.1 and refactor the
code so that it will be easier to manage.
You can test the application and download the source
code at
http://www.gabrijelcic.org/Smart/BlaisePascal/.
While restructuring the code I still found time to do some
small enhancement. In this version, editing is supported
(previously you could only add new to-do items), as is
item persistence in the browser's local storage. (For more
information on Web local storage, see Wikipedia:
http://en.wikipedia.org/wiki/Web_storage#localStorage).
The program appearance (CSS styling) has also been
improved.

Structured code
The ToDoList v3 has been split into several units. I tried to
separate view and data models from each other but I didn't
follow any design pattern, such as MVC, MVP or MVVM.
On the model side, we have two units. ToDoModel stores a
data model while ToDoModelSerializer knows how to
serialize and deserialize this model into a textual
representation. Persistence layer is implemented in the
ToDoStorage unit.
The view (GUI) part contains forms ToDoMain and
ToDoAbout, frame ToDoCategoryFrame and a modal
dialog ToDoTaskDlg. In Smart, frames and dialogs are not
natively supported but we can design them as normal
forms which are then used in a special way.
Connecting the view and the model is a view-model unit
ToDoListTemplate which represents one to-do item.

objects which describe individual to-do items. All model


classes are implemented as a pure JavaScript objects. This
type of objects is usually only used for external classes
(Pascal classes that serve just as an interface representation
of external JavaScript objects) but in this case I have used
them as normal Pascal-side objects.
The reason for using pure JavaScript objects will be
explained in the next section (Serialization).
Instead of showing the entire ToDoModel source, I'll
concentrate just on the most important part the list of todo items.
type
JToDoEntity = class(JObject)
public
constructor Create;
end;
JToDoItem = partial class(JToDoEntity)
protected
property OnModified: TNotifyEvent;
public
ID: integer;
Task: string;
Detail: string;
Priority: integer;
Category: string;
procedure Modified;
end;
JToDoItemList = partial class(JToDoEntity)
protected
Items: array of JToDoItem;
function GetItem(idx: integer): JToDoItem;
public
procedure Add(item: JToDoItem);
function Count: integer;
property Item[idx: integer]: JToDoItem
read GetItem; default;
end;

There are two other units in the program. ToDoList


represents the main program (a .dpr file in Delphi) and
ToDoCommon contains some configurable parameters.
I have tried to introduce some order by using hierarchical
names (ToDo.Model, ToDo.Model.Serializer etc) but Smart
1.1 has some problems with hierarchical unit names and I
had to revert to the naming scheme described above.

The JtoDoEntity class is a base for all model classes (except


the TToDoModel, which is a normal Pascal class that
binds all pure JavaScript classes together). It is derived
from the JObject pseudo-class which represents basis for all
pure JavaScript classes in Smart. As the pure JavaScript
classes don't contain a default constructor, we have to
provide one. (If you check the code, you'll see that it does
exactly nothing).

Model
Let's start our walk through the program with the data
model. At the moment it is (intentionally) very simple.
A model class contains a reference to a category list and an
item list. A category list contains just an array of strings
(category names) and an item list contains an array of item

The JToDoItem class represents one to-do list item. It is


implemented as a partial class which means that it can
be extended in another unit. This is necessary because the
ToDoModelSerializer unit extends it with a serialization
support.
The JToDoItemList class represents a
list of to-do items. They are stored in
an array. In Smart, arrays represent
JavaScript arrays and are as such
almost equivalent to Delphi's
TObjectList in functionality.
The full model is exposed as a
singleton object of a TToDoModel
class. This class combines the pure
JavaScript model with manipulation
methods and an interface to the
storage system (implemented in the
ToDoStorage unit).

Figure 1: A data model.)

34

COMPONENTS
DEVELOPERS

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

COMBINED PACKAGE
http://www.blaisepascal.eu

LEARNING
TO PROGRAM USING LAZARUS
LAZARUS
THE COMPLETE GUIDE

The complete Package 60,00 (Paperback) includes a download subscription of BLAISE PASCAL
MAGAZINE and the book LEARNING TO PROGRAM USING LAZARUS as pdf
Windows installer for Lazarus / Linux for Lazarus / Mac for Lazarus / Lazarus Portable, including a
prenstalled Lazarus on an 8 GB USB stick (Click and Go) / 60 additional sample projects / additional
prenstalled component suites on USB Stick / LEARNING TO PROGRAM USING LAZARUS as pdf
Blaise Pascal Magazine Library (LIB STICK) - Completed up to all 26 issues / ALL ON USB STICK

.iOS Development

for lazarus Part 2

By Joost van der Sluis

type
NSTableViewDelegate = objcclass(NSObject,
starter
expert Lazarus 1.1 or higher
UITableViewDataSourceProtocol)
public
The first article in this iOS series explained how to use
function tableView_numberOfRowsInSection(
native iOS controls in Lazarus, using the form designer
tableView: UITableView;
to create the layouts (see the previous Blaise issue).
section: NSInteger): NSInteger;
That article also included a short introduction to
message 'tableView:numberOfRowsInSection:';
FPC's Objective-Pascal language extensions and the
function tableView_cellForRowAtIndexPath(
Objective-C classes. To exploit the full potential of
tableView: UITableView;
native iOS controls you should use the design patterns
indexPath: NSIndexPath): UITableViewCell;
that Apple advocates and on which Apple bases the
message 'tableView:cellForRowAtIndexPath:';
entire iOS developer kit.
end;
This second tutorial article illustrates some of those
design patterns by showing you how to create a simple
application with a tableview.
Note that the class name does not start with a 'T'.

Tableviews are one of the most important controls in iOS


applications. They are used to display a list of multiple
items and are eminently customizable. Begin by creating a
new iOS application with a UIWindow and drop a
UITableView on it. You will probably have to resize the
UITableView to see what it looks like.
You could run the application (in the simulator or on a
real device) to see that the tableview remains empty,
although at design-time there are some items visible.
This is because adding data to your tableview has to be
done in code.
That's not a missing feature in Lazarus but how Apple
designed it. The items that you see in the designer are just
there to help you get an idea of how the finished
application will look.

That's because in Objective-C (and thus in Objective-Pascal)


it is normal to start the class-names with 'NS'.
This also makes it easier to differentiate between a
standard Pascal class and an Objective-C class. I also called
the class 'Delegate'. Why this is done is explained later.
Now you can control-click on the word
'UITableViewDataSourceProtocol' to see how it is defined.
As you see, the two methods defined above are required,
and there are some optional methods.
I don't discuss these, but you can guess their purposes
from their names. If you search for them on the net, you
will find thousands of examples, since they are used
heavily in iOS apps.
These functions are used identically to the way they are
used in Objective-C, except for the different syntax.
To create the code for the NSTableViewDelegate class, we
now place the cursor within the class definition and press
ctrl-shift-c. Adapt the code so that it looks like this:
{ NSTableViewDelegate }
function NSTableViewDelegate.
tableView_numberOfRowsInSection(
tableView: UITableView;
section: NSInteger): NSInteger;
begin
result := random(50);
end;

function NSTableViewDelegate.
tableView_cellForRowAtIndexPath(
tableView: UITableView;
indexPath: NSIndexPath): UITableViewCell;
var
s: string;
begin
result := tableview.
dequeueReusableCellWithIdentifier(
NSSTR('DefTableItem'));
if not assigned(result) then
begin
result := UITableViewCell.alloc.
initWithStyle_reuseIdentifier(
So how do we add data to a tableview? To do this you
UITableViewStylePlain,NSSTR(
have to create a datasource and bind it to the UITableView.
'DefTableItem'));
This datasource is not the datasource you might know
result.setAccessoryType(
from working with default database controls, but an
UITableViewCellAccessoryDisclosureIndicator);
Objective-C class that implements the
end;
if odd(indexPath.Row) then
UITableViewDataSourceProtocol. As explained in the
result.textLabel.setText(nsstr('Item 1'))
previous article, a protocol is part of the Objective-Pascal
else
extensions, and is something like an interface with optional
result.textLabel.setText(nsstr('Item 2'));
methods. Thus to create a datasource we have to define our end;

own objcclass that implements the


UITableViewDataSourceProtocol, which requires adding
the following code to your unit (the code can be placed in a
separate unit, but this is not necessary):

42

COMPONENTS
DEVELOPERS

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Matching files By Peter van der Sman


starter

expert Delphi 5 and later

Sometimes when you're browsing the files on your


computer you wonder Surely I already have that file
somewhere? Then you also wonder whether the two
files you have are the same or not. You may have a
duplicate-file-finding program somewhere, and the
question is why you don't use it. Because it is not that
you never deal with file duplication, but rather that the
problem posed by the existence of matching files tends
to be different every time.
Usually when I encounter a problem like this I find
the best solution is to implement a customised answer
to it myself.
Recently I had to compare numerous files with each
other, and each time I had the same questions:
What is in both files? What is only in file A?
What is only in file B?.
In my case the files were word lists, but the same
problem arises with membership lists, stamp collections
and so on. It would be rather handy to have a simple
tool designed to resolve exactly this type of problem.
To give you an example I wrote two small files based on
a section of the (Dutch) text of this article. Each file
contains a word-for-word translation (one in English and
one in Spanish). The exercise then is how to combine
the two files into a three-language word list.
I also introduced some numbers and extra information
just to make it a bit more complicated and more
interesting.

A universal algorithm for file matching


To compare two text files we can employ the following
universal algorithm:
1. Sort both files (FileA and FileB) on the chosen key.
2. Take the first line/record in each file
(RecA and RecB).
3. Find the keys in RecA and RecB and compare them.
There are three scenarios:
a. RecA=RecB: mark that both records match, and
select the next line in both files
b. RecA<RecB: mark RecA as unique, and select
the next line in FileA
c. RecA>RecB: mark RecB as unique, and select
the next line in FileB
4. If each file has at least one
remaining line continue
from step 3.
5. If one file has lines
remaining after completely
working through the other
file, mark any vander
Smanremaining
lines as unique.

46

COMPONENTS
DEVELOPERS

Thats all there is to it!


In principle this approach always works. However it is not
always the most efficient method. For instance, to look up
the value of a stamp in a worldwide stamp database you
dont download the whole database, sort it and look for a
match against your particular item. You would perform a
query on the database to return a single piece of
information!
Note that matching can go wrong for a variety of
reasons. Suppose in a file of names you use only the first
name as a comparison key, then it is obvious that you're
likely to find more than one person named David in your
file. Without unique key values you'll end up matching
incorrectly.
Another pitfall is using data files that (perhaps
unknown to you) contain errors. In my whole life I have
never met an Englishman who could pronounce my first
name the way it is pronounced in Dutch. They all
pronounce it in the way we pronounce the first name
Pieter. So possibly, due to verbal miscommunication, I
can be found as Pieter in some files.
By the way: commercial databases often contain
erroneous data of this sort. This is deliberately inserted so
that if the data is used illegally there is clear proof of such
data theft. When you complain, the company will correct
the error in an updated version, and another Peter will
be renamed to Pieter.
Another pitfall you will find in using the program with
real data is that files may contain duplicate data
(incorrectly and without you being aware of it).
In that case the algorithm above will mark one of the two
duplicates as unique!
So the moral is: file matching can be enjoyable, but never
blindly trust the results. Always do some checking
afterwards!

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Book Review By James D (Jim) Duff


Start Programming using Object
Pascal - Free Pascal/Lazarus Book
Author:
Motaz Abdel Azeem, who graduated from Sudan
University of Science and Technology in 1999.
He is a Software Developer who lives in Khartoum.
First Editor: Pat Anderson, who graduated from
Western Washington State College in 1968 and Rutgers
Law School in 1975.
Second Editor: Jason Hackney, a graduate of Western
Michigan University's College of Aviation.
Number of chapters: 4 / Number of Pages: 150
Introduction
The list of Contents below is a minimised list, as there are
several items, such as sample program names, that have
been excluded to save space for this review;
you will understand the issue of minimising once you start
reading the Book Review comments further down.
Contents
Introduction to The Object Pascal Language, Delphi, Free
Pascal and Lazarus - Object Pascal features
Environment for book examples
Chapter One - Language Basics
Our First Application
Variables, Sub types, Conditional Branching, The If
condition, Case .. of statement, Loops, For loop, Factorial
program, Repeat Until loop, While loop, Strings, Copy
function, Insert and Delete procedures, Trim function,
StringReplace function, Arrays, Records, Files, Text files
Random access files, Typed files, File copying, Date and
Time, Date/time comparison, Constants, Ordinal types,
Sets, Exception handling, Try except statement, Raise an
exception

Book Review
This is a quotation of the book's introductory paragraph:
Introduction
This book is written for programmers who want to learn
the Object Pascal Language. It is also suitable as a first
programming book for new students and nonprogrammers. It illustrates programming techniques in
general in addition to the Object Pascal Language."
The above opening paragraph is a relevantly short and
accurate description of what this book is all about: short
and accurate, as the idea behind the book is to get
newcomers straight into Pascal programming via minimal
initial documentation, plus a very quick and easy
generation of their first program.
The first set of instructions in the Contents section
"Environment for book examples" says: "We will use
Lazarus and Free Pascal for all the examples in this book.
You can get the Lazarus IDE, including the Free Pascal
compiler, from this site: http://lazarus.freepascal.org." A
few other points are raised regarding usage of Linux,
Ubuntu or Fedora, but for my purposes to follow the
instructions I merely had to click on the Lazarus link,
download and install it under Windows 7. Hopefully, the
average newcomer in this day and age would be able to
follow such instruction easily and get through in a very
short time without any problems. Step one of two to get
started completed.
In many books or demonstrations of Pascal systems
containing a productive GUI, updates or other
enhancements, the first sample is usually a GUI based
"Hello World". However, in this book, the first part is
explained and demonstrated via console applications in
text mode/command lines, while the GUI and Object
Oriented sections come in as the second part.
Once past the Introduction and table of Contents, the
starting part of the first page of Chapter One contains this
sample:

Chapter Two - Structured Programming


Procedures, Parameters, Functions, Local Variables
Functions as input parameters, Procedure and function
output parameters, Calling by reference, Units in Lazarus
and Free Pascal, Calendar, Procedure and function
Overloading, Default value parameters, Sorting - several
methods and samples
Chapter Three - The Graphical User Interface
Two initial GUI (Graphical User Interface) applications,
plus a ListBox,
Text Editor and News Applications
Chapter Four - Object Oriented Programming
First example: Date and Time
News application in Object Oriented Pascal, Queue
Application, Object Oriented File, Copy files using
TFileStream Inheritance

48

COMPONENTS
DEVELOPERS

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Special announcement:
Bob Swart in collaboration with BLAISE PASCAL MAGAZINE:
subscribers having a magazine download subscription will be given a 10 euro discount
on their order. Subscribers having a printed magazine subscription will be given a 20
euro discount. This discount is offered per subscriber (not per book), so irrespective of the
number of Courseware books ordered, each subscriber will given a single 10 or 20 discount for
the one order only. To order via Blaise Pascal Magazine you can contact Detlef Overbeek at
office@blaisepascal.eu for delivery within 48 hours.

42
eBob42

.com

Bob Swart's Delphi Courseware books


Bob Swart's courseware manuals are used in training and programming workshops around the world. You can obtain Bob's
books from Blaise Magazine as individual PDF files which are updated over the following 12 months for free. For instance,
currently each PDF contains screenshots based on Delphi XE2 features, but an XE4 update will will be available shortly. So if
you buy a courseware manual now, in a few months (without further payment) you will receive an XE4 download edition
enlarged to cover the new features of Delphi XE4, in which Bob gives details about iOS, DataSnap and XML/SOAP
development.

Delphi iOS Development


This book is about configuring your Delphi and Mac OS X environments so you can design, compile, debug and deploy
iOS applications. The book includes extensive discussion of the database and multi-tier (DataSnap) potential of iOS
development.
See http://www.drbob42.com/courseware/56/56.pdf which lists the table of contents for the current XE2 edition.

Delphi DataSnap Development


This book shows you how to design, build, compile and deploy multi-tier DataSnap applications using Delphi XE2, and
includes sections on DBX and REST techniques.
See http://www.drbob42.com/courseware/53/53.pdf which lists the table of contents for the current XE2 edition.

Delphi XML, SOAP & Web Services


This manual explains XML Document Programming and how to use SOAP Web Service techniques in Delphi, including
coverage of SOAP Servers as Clients.
See http://www.drbob42.com/courseware/52/52.pdf which lists the table of contents for the current XE2 edition.
Each book costs 99 euros (excluding VAT). You can order any of these books at this price by sending an email
to Bob@eBob42.com Please give the name and email address of the developer who will be using the ordered
book(s), and specify clearly the titles of the PDF files you are ordering. You will also receive a Delphi
Development Essentials PDF as a free bonus with your order!
See http://www.bobswart.com/courseware or http://www.eBob42.com/courseware for more details.

Delphi XE4 iOS DataSnap Clients


starter

By Bob Swart (DrBob)

expert

Delphi XE4 and later Select a VCL Forms Application, in the next page make
sure to select TCP/IP (and use the default port 211,
although I would recommend to change that port number
Delphi XE4 was released a little while ago, and
to a different number when you want to deploy the
contained one big feature compared with Delphi
application). Select a Server Method Class with Sample
XE3: the support for iOS development.
Methods, and change the TComponent ancestor type to
Technically, this feature is only available in the
TDSServerModule (so we can call ApplyUpdates when
Enterprise edition (or when you purchase the
needed).
Mobile Development AddOn package), so this
Save the project, using the generated filenames (although
article will be of less "use" for people who only
you can save the main form in MainForm.pas instead of
have the Professional edition of Delphi.
UnitXXX.pas).
On the Server Methods unit, we will now place some data
DBX Clients
access components to connect to a database. In this
Delphi XE2 with Update #4 offered the ability to use the
example, I'll use InterBase, but we can also use any other
Mobile Connectors to write DataSnap Clients for mobile
database of course. Place a TSQLConnection component on
devices using the REST protocol (because many of the
the ServerMethodsUnit1. Set the Driver property to
clients were written in other languages like Java, C# or
InterBase Server (or another value, if you want to use
Objective-C). We could also use FireMonkey for iOS in
another database). Set the LoginPrompt to False, and the
combination with the FreePascal Compiler to write
Database to C:\Users\Public\Documents\RAD
DataSnap clients for iOS using REST. But this technique is
Studio\11.0\Samples\Data\EMPLOYEE.GDB (or the
now outdated.
location of the EMPLOYEE database on your machine).
With Delphi XE4, we are no longer limited to REST and
Now, in order to validate the settings, we can set
HTTP, but can also communicate using DBX and TCP/IP.
Connected to True. If this works (without errors), make
This is great news, since DataSnap DBX is a more powerful sure to set it back to False again.
architecture than the DataSnap REST capabilities (as
explained in more detail in my DataSnap Development
Next, place a TSQLDataSet next to the TSQLConnection.
courseware manual).
Point the SQLConnection property to the TSQLConnection

In this article, I will quickly build a DataSnap DBX Server,


and spend most of the time using Delphi XE4 to build an
iOS client for this DataSnap Server.
DataSnap DBX Server
To build a DataSnap DBX Client, we first need to have a
DataSnap DBX Server, which is a simple matter of using
the New DataSnap Wizard.

52

COMPONENTS
DEVELOPERS

component, and enter the following SQL in the


CommandText property:
SELECT FIRST_NAME, LAST_NAME, FULL_NAME,
HIRE_DATE FROM EMPLOYEE
In order to test the SQL, set Active to True (and back to
False again, after which you also need to set the Connected
property of the TSQLConnection
back to False again I'm afraid).
Now, place a TDataSetProvider on
the Server Methods unit, points its
DataSet property to the
TSQLDataSet, and change the
name of the TDataSetProvider to a
sensible name (one that will make
it clear to "clients" what data they
can expect). For our example, I've
changed the name to
dspEmployee, which results in the
following overview of the Server
Methods Unit at design-time:

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

Delphi XE4 iOS DataSnap Clients (Continuation 2)


Finally, we need a TClientDataSet component. Set the
RemoteServer property to the TDSProviderConnection
component, and then open up the ProviderName property.
If you did not make a mistake along the way (for example
with the ServerClassName property of the
TDSProviderConnection component), then you will now
see the one and only choice dspEmployee in the dropdown listbox. Select that one.
Set the Active property of the TClientDataSet to True, to
verify that we can connect to the DataSnap Server and
retrieve the data.

procedure THeaderFooterForm.btnOpenClick(Sender:
TObject);
begin
ShowMessage('test');
end;

After you've set Active back to False, make sure to set the
Connected property ot the TSQLConnection component
also back to False again. This will ensure that the iOS
DataSnap Client does not make a connection when you
open the project (or when you run the app itself). We will
add some code to connect to the DataSnap Server and
retrieve the data in a minute.

Do Project | Deployment, to view the deployment page.


Then, click on the 4th speedbutton from the left (to add
feature files), and in the dialog that follows, check the
iOSSimulator option for the MIDAS Library.

Before we can deploy the application, we need to ensure


that the MIDAS library is also included. On Windows, this
is of course already taken care of using the MIDAS.DLL or
- even more effective - the MidasLib unit. But for OSX or
the iOSSimulator, we need to explicitly check the MIDAS
Library.

Now all we need to place the data, is a TListBox for


example. Set Align to Client, to it will take the space
between the Header and Footer.

Then, close the dialog, compile and run the DataSnap


Client application from the IDE. It will show up in the
iOSSimulator on your Mac. We can click on the Button (on
the Footer) to get the OnClick event.
The final test involves opening the TClientDataSet, and
entering the data into the TListBox. This can be done by
modifying the OnClick event handler as follows:

Place a TButton component on the Footer, set the Text


property to Open, the Name property to btnOpen, and
write the following code in the OnClick event handler:

54

COMPONENTS
DEVELOPERS

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

LEARN TO PROGRAM
USING LAZARUS 1.0

Good news for startes


has publishd a book in English
aimed at people who are just setting
out to learn to code.
It is called

Learn to Program
using Lazarus 1.0,
and is written by Howard Page-Clark,
our editor, corrector
and writer of many articles
Among the many topics introduced are:
Pascal types, the Lazarus IDE,
Coding discipline,
GUI editing components,
Pascal files and streams,
Object oriented principles,
debugging techniques.
As Loose Leaf Book
35 plus postage 17,50
As PDF File
25 no postage

50

Intro to kbmMW connectivity package 'Spider'


starter

expert

Delphi 2009 and later


kbmMW supports a number of native clients under the
codename Spider.
It contains clients for kbmMW enabling direct access
from the following platforms:
- .Net on desktop and server
- .Net on Compact Framework
(Microsoft PocketPC/Mobile 2003 and up)
- Java Standard Edition
- Java Enterprise Edition
- C/C++ on many different platforms
- PHP on Windows
- PHP on Linux
- OCX for access to kbmMW application servers from
for example Microsoft Office, CodeFusion and other
frameworks supporting OCX.
- Adobe Flex

All clients come with full source and comprehensive


documentation, giving you not only comprehensive details
of the functionality, but also how to install and compile the
code.It is bundled with the kbmMW Enterprise edition
and installs in the kbmMW folder but it can be purchased
as a separate download.
.NET version
The kbmMW C# client library contains native C# based
classes that allow a developer to access a kbmMW
application server, in a similar way as using
TkbmMWSimpleClient with a traditional request/response
transport like TkbmMWTCPIPIndyClientTransport.

APACHE FLEX
VIA kbmMW
SPIDER/FLEX

JAVA
VIA kbmMW
SPIDER/JAVA

By Fikret Hasovic

The library is compatible with both .Net Standard


Framework and .Net Compact Framework.You probably
already know that in order to use .net version you are
supposed to have .net framework and SDKinstalled, and
.Net CF SDK if you need compact framework capability. In
\{app}\dotNet\bin you can find pre-compiled binaries.
The pre-compiled assemblies can then be installed or
referenced from all .Net development environments, and
must be copied to end user machines when deploying an
application relying on the kbmMW C# client library.
The library contains several classes which generally are
modelled according to the same structure as
the main Delphi kbmMW client classes
A basic setup requires an instance of
TkbmMWTCPIPTransport and TkbmMWSimpleClient. Eg.
4.21 Contains many new features, including a new
high performance RTTI based object marshalling
mechanism, making it extremely easy to serialize
complex objects with their dependencies to and
from XML. Remote Desktop has been updated to v.
2 and further improves performance and usability.
As always the full source for Remote Desktop is
included with kbmMW Enterprise Edition.

XE4 is about to be supported, with IOS


support expected too.

C/OBJ.C
VIA kbmMW
SPIDER/C

PHP
VIA kbmMW
SPIDER/PHP

.NET
VIA kbmMW
SPIDER/.NET

HTTP
SERVER

KBMMW
APP
SERVER

HTTP
VIA kbmMW
AJAX
TRANSPORT

PC
SOAP
VIA kbmMW
SOAP
TRANSPORT

DATABASE
SERVER
DATABASE
SERVER
DATABASE
SERVER

DELPHI / C++ BUILDER


OS X / iOS /
WIN 32 /WIN64
VIA THE kbmMW STANDARD
TRANSPORT

Nr 2 / 2013 BLAISE PASCAL MAGAZINE

XML
VIA kbmMW
AJAX
TRANSPORT

COMPONENTS
DEVELOPERS

57

Looking into a bright future


New V4.21 available for DELPHI 2009 up to XE4 -32 and 64
On iPad and iPhone Full kbmMW support (client and server)
The Delphi Starter Edition now also has the
ability to do multi tier development for no cost at all.
Pro/Ent is available for Win32/Win64/OSX/FPC.
The CodeGear Edition is for Delphi XE2 / Win32 only and
provides access to SQLite in addition to the standard
Delphi Starter Edition database
connectivity
frameworks, BDE and IBExpress.

4.21 Contains many new features, including a new


high performance RTTI based object marshalling
mechanism, making it extremely easy to serialize
complex object with their dependencies to and
from XML. Remote Desktop has been updated to v.
2 and further improves performance and usability.
As always the full source for Remote Desktop is
included with kbmMW Enterprise Edition.

Delphi Starter Edition also lacks proper XML support


and the local TClientDataset, which is also to be
found as part of kbmMW Code Gear Edition in
the form of
TkbmMWDOMXML and the high
p e r f o r m a n c e
T k b m M e m T a b l e .
In addition its possible to upgrade to kbmMem
Table Standard Edition for only US$30.
The upgrade includes full source for kbmMem
Table, and includes kbmSQL which provides a SQL
frontend to kbmMemTable.

For kbmMW there are multiple new items: Remote


Desktop Client/Server/Proxy Support, NEW
JSON support, JSON streaming of kbmMemTable
datasets, bugfixes and more. Improved HTML
template support,improved Cookie Support etc.
Lots of improvements related to using kbmMW as a
web
server producing dynamic web pages.
kbmMemTable on Win64.
Tests done:
10 million records in memory
with multiple fields and indexes...
XE4 is about to be supported, with IOS support
expected too.

COMPONENTS
DEVELOPERS

ESB, SOA,MoM, EAI TOOLS FOR INTELLIGENT SOLUTIONS.


kbmMW IS THE PREMIERE N-TIER PRODUCT
FOR DELPHI / C++BUILDER BDS DEVELOPMENT
FRAMEWORK FOR WIN 32
/ 64, .NET AND LINUX
WITH CLIENTS RESIDING ON WIN32 / 64, .NET, LINUX, UNIX MAINFRAMES, MINIS, EMBEDDED DEVICES, SMART
PHONES AND TABLETS.

You might also like