Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now

Issue 16.2 ('StockScripter')
Instant purchase and download via GumRoad!


A Predicate For Data, Part 1

Building and implementing a basic predicate model

Issue: 16.2 (March/April 2018)
Author: JC Cruz
Author Bio: JC is a freelance writer based in British Columbia. He is a regular contributor to MacTech Magazine and Dr Dobb's Journal. Away from the writing pile, JC spends quality time with his nephew, as a proper uncle should.
Article Description: No description available.
Article Length (in bytes): 37,870
Starting Page Number: 66
Article Number: 16206
Resource File(s):

Download Icon project 16206.zip Updated: 2018-02-28 18:43:13

Related Link(s): None

Excerpt of article text...

Predicates play an important part in data queries and transactions. They limit the query results to a specific set, and they set the conditions for changes.

In today's article, I demonstrate how I implement a predicate model. I begin with an overview of predicates in SQL, explaining their syntax and their effects on various operations. I shall design a model class, define the methods for constructing and managing a predicate. And I shall use the predicate model from within a data model and a controller module.

Readers need a working knowledge of REALbasic, SQLite and object-oriented design. The updated version of the demo project FooHealth (Mk12) is available from the magazine's website.

Predicates in SQL

A typical SQL statement has one or more clauses. First is the command clause, which declares the action and the data table to be acted upon. Next is the schema clause, which defines the data fields affected by the action. Last is the predicate clause, which sets the action's scope and behaviour.

...End of Excerpt. Please purchase the magazine to read the full article.