beautypg.com

Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 445

background image

C H A P T E R 1 1

Data Storage and Retrieval

About Data Storage on Newton Devices

11-13

exclusive forms of the same endrange selector; for example, a single query spec
cannot specify both a

beginKey

value and a

beginExclKey

value.

Another important point to understand is that there is only one

beginKey

or

beginExclKey

value, and only one

endKey

or

endExclKey

value associated

with any query and the cursor it returns.

Figure 11-4

Using

beginExclKey

and

endExclKey

values to specify

a subrange

Each

beginKey

,

beginExclKey

,

endKey

, or

endExclKey

specification

evaluates to a single value that has a unique position in the sorted index key data.
This position marks one end of the range over which the cursor iterates. The cursor
never moves to a position outside the range specified by these keys.

If any endrange selectors are defined for a query, the relationship of the cursor’s
entries to the endrange selectors may be summarized as follows:

entry

> beginExclKey

entry

beginKey

entry

endKey

entry

< endExclKey

You can think of these values as being used by the system in an inequality
expression to specify the range of the cursor; for example,

beginKey

entry

< endExclKey

Note that if a valid entry is not found at the key value specified for an endrange
selector, the cursor is positioned on the nearest entry in index key order that falls
within the range specified by the endrange selectors. For example, if a valid entry is
not found at the key value specified for a

beginKey

or

beginExclKey

value, the

Ascending key order

Descending key order

subrange of index key values

3 4 5

beginExclKey

endExclKey