C H A P T E R 2 1
Routing Interface
21-28
Using Routing
entry and even some of the slots from the soup entry. Note that you must use name
references; you cannot specify soup entries directly.
To create a name reference object, use name reference data definitions registered
with the system in the data definition registry. There are built-in name reference
data definitions for e-mail (
'|nameRef.email|
), fax (
'|nameRef.fax|
), and
call (
'|nameRef.phone|
) information associated with names from the Names
file. These data definitions contain a method,
MakeNameRef
, that creates and
returns a name reference.
You can pass a Names soup entry directly to
MakeNameRef
, or you can construct
your own simple frame of information that contains the appropriate slots. Fax and
call name references should include the slots
name
,
phone
, and
country
. E-mail
name references should include the slots
name
,
email
, and
country
. For more
information about these slots, see "Names Soup Format" (page 16-15) in Newton
Programmer's Reference.
Here's an example of how to create a name reference for a fax phone number or an
e-mail address:
// use a Names file entry directly
local myData := aNamesFileEntry; // entry from Names soup
// or create your own fake entry frame based on other info
local myData := {
name:{first:"Juneau", last:"Macbeth"},
phone: "408-555-1234", // fax phone string
email: "
[email protected]", // e-mail address string
country: "USA",
}
// then create the fax name reference
aToRef := GetDataDefs('|nameRef.fax|):MakeNameRef(myData,
'|nameRef.fax|);
// or create the e-mail name reference
aToRef := GetDataDefs('|nameRef.email|):MakeNameRef(myData,
'|nameRef.email|);
For more information about name references and the
MakeNameRef
method, see
the documentation of
protoListPicker
in Chapter 6, "Pickers, Pop-up Views,
and Overviews."
Specifying a Printer
21
For print operations, the
printer
slot of the item frame specifies which printer to
use. This slot must contain a printer frame. The only valid way of obtaining a
printer frame is from the
currentPrinter
variable of the user configuration