background image
C H A P T E R 2 3
Endpoint Interface
About the Endpoint Interface
placeholder or default values, which the system fills in when the data is received.
For more information, see the section "Specifying the Data Form and Target"
beginning on page 23-13.
The data types that can be used in the
array are identified by these
, and
. They are described in detail in "Data Type
Symbols" (Table 20-2 on page 20-3) in Newton Programmer's Reference.
Note that the
data types are not used alone, but in
conjunction with other elements in a
array. They modify how the other
elements are treated. The
data type defines the array as an aggregate
structure of various data types that is padded to a long-word boundary (4 bytes in
the Newton system). Note that the whole structure is padded, not each array
element. You must specify the
data type in order to include more than
one type of data in the array.
data type defines the array as an aggregate array of one or more
elements of a single data type. The
data type is specified as a NewtonScript
array of three items, like this:
Replace the dataTypeSymbol with one of the other simple data types. And integer is
an integer specifying the number of units of that data type to convert. To convert an
entire string, including the terminator, specify zero for integer. A nonzero value
specifies the exact number of units to be converted, independent of a termination
character in the source string.
Here are some examples of how to use the
data type to represent C strings
and Unicode strings in NewtonScript. The first example shows how to convert
between a NewtonScript string of undefined length and a C string (translated
to/from Unicode):
['array, 'char, 0]
This example shows how to convert a four-character NewtonScript string to a C string:
['array, 'char, 4]
This example shows how to convert between a NewtonScript string and a
Unicode string:
['array, 'unicodechar, 0]
data form is intended primarily as a means of communicating
with the lower level communication tools in the Newton system. You can use this
data form to communicate with a remote system, however, you must be careful and
know exactly what you are doing to use it for this purpose. Remember that the
lengths of various data types and the byte order may be different in other systems
and may change in future releases of the Newton operating system.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна