beautypg.com

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

Page 501

background image

C H A P T E R 1 1

Data Storage and Retrieval

Summary of Data Storage

11-69

Multiple-Slot Index Specification Frame

11

{

// index keys may be multiple slot values

structure: 'multiSlot, // must use this value

// up to six path expressions specifying indexed slots

path:[

pathExpr1

,

pathExpr2

, … ,

pathExpr6

],

// data type found in each indexed slot

type:[

sym1

,

sym2

, …

sym6

]

// optional. 'ascending or 'descending

order: [

sym1

,

sym2

, …

sym6

]

// optional. pass 1 to use alternate sort table

sortID: nil

}

Tags Index Specification Frame

11

{

// must use this value - tags are slot values

structure:'slot,

// index values (tags) extracted from this slot

path:'

slotName

,

// must use this value

type:'tags,

}

Query Specification Frame

11

// pass nil instead of a query spec frame

// to retrieve all entries in the soup

// this frame used for queries on single-slot indexes

// see next example for multiple-slot query spec frame

{

// use the specified single-slot index for this query

// required when querying for index values

indexPath : '

pathExpr

,

// minimum index key value examined by this query

// for all entries, (beginKey

entry.indexPath)

beginKey :

keyValue

, // optional

// excluded lower boundary of key range examined by query

// for all entries, (beginExclKey < entry.indexPath)

beginExclKey :

keyValue

, // optional