Chapter 5. Datatypes

The REALbasic language provides several irreducible types of data; this chapter describes them. Some of these datatypes are scalars; all of REALbasic’s scalar types are dealt with here. Others are classes, but are distinguishable as being neither features of the interface (dealt with in Part II) nor means of communicating with the world beyond your application (dealt with in Part III). Threads are not usually considered a form of data—functionally, they have to do with the flow of execution—but they are a fundamental feature of the REALbasic language, like datatypes, so they have ended up in this chapter as well.

Booleans

A boolean is a scalar datatype that can have one of just two values: true or false. Booleans have their own rules of arithmetic, as it were, whereby it is possible to combine boolean values into larger constructs, or expressions , which can be quite complicated.[50] The chief use of boolean expressions is as conditions (Section 2.4). Any of the following constitutes a boolean expression:

  • The word true

  • The word false

  • A name, such as a variable, to which a boolean value has been assigned

  • A call to a function that returns a boolean value

  • Two values compared by any of the comparison operators =, <, >, <=, >=, or < >

  • A reference to an instance and a class name combined by the operator IsA

  • A boolean expression acted upon by the operator Not

  • Two boolean expressions combined by the operator And

  • Two boolean expressions combined by the operator ...

Get REALBasic: TDG, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.