Apple Newton Utilities User's Guide Page 834

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 833
CHAPTER 23
Endpoint Interface
23-6 About the Endpoint Interface
placeholder or default values, which the system lls 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
typelist array are identied by these
symbols:
'long, 'ulong, 'short, 'byte, 'char, 'unicodechar,
'boolean, 'struct, and 'array. They are described in detail in “Data Type
Symbols” (Table 20-2 on page 20-3) in Newton Programmers Reference.
Note that the
'struct and 'array data types are not used alone, but in
conjunction with other elements in a
typelist array. They modify how the other
elements are treated. The
'struct data type denes 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
'struct data type in order to include more than
one type of data in the array.
The
'array data type denes the array as an aggregate array of one or more
elements of a single data type. The
'array data type is specied as a NewtonScript
array of three items, like this:
['array, dataTypeSymbol, integer]
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
species 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
'array data type to represent C strings
and Unicode strings in NewtonScript. The rst example shows how to convert
between a NewtonScript string of undened 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]
The 'template 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.
Page view 833
1 2 ... 829 830 831 832 833 834 835 836 837 838 839 ... 941 942

Comments to this Manuals

No comments