Specifying the data form and target 23 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 841

Advertising
background image

C H A P T E R 2 3

Endpoint Interface

Using the Endpoint Interface

23-13

The following sections describe how to set the various slots in the input spec to
accomplish specific tasks.

Specifying the Data Form and Target

23

You can choose how you want the received data formatted by setting the

form

slot in the input spec. In this slot, you specify one of the standard data forms
described in “Data Form Symbols” (Table 20-1 on page 20-2) in Newton
Programmer’s Reference
.

In preparation for receiving data, the system creates an input buffer. The buffer’s
size is based on the input spec slot

termination.byteCount

, on the slot

discardAfter

, or on the intrinsic size of the data. The system receives all the

data in to this buffer, then translates the data into a newly created object whose type
is specified by the input spec’s

form

slot. It is this object that is passed back to the

InputScript

method.

Table 23-2

Input spec slot applicability

Data form

target

slot

termination

slot

discard
After

slot*

filter

slot

partial
Frequency

and

partial
Script

slots†

'char

na (not applicable)

determined
automatically

na

OK

na

'number

na

determined
automatically

na

OK

na

'string

na

OK

OK

OK

OK

'bytes

na

OK

OK

OK

OK

'binary

data

and

offset

slots only

all slots except

endSequence

na

na

na

'template

typelist

and

arglist

slots only

determined
automatically

na

na

na

'frame

na

determined
automatically

na

na

na

*

discardAfter

is written as one word, broken here because of space limitations.

partialFrequency

and

partialScript

are written as one word, broken here because of space limitations.

Advertising