Apple Newton Utilities Betriebsanweisung Seite 664

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 942
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 663
CHAPTER 18
Intelligent Assistant
18-18 Using the Assistant
Sample PostParse Method 18
The following code fragment is an example of a PostParse method that tests for
the existence of the
value slot and accesses its content:
PostParse: func()
begin
local thePhraseText;
// self is the task frame
if hasSlot(self, 'value) then
thePhraseText := self.value;
else
// handle missing input
end;
// display phrase text in task slip
end;
end;
Dening the Task Template 18
Your task template denes a primary action and its supporting data structures.
Take the following steps to dene a task template:
1. Dene a frame containing the
value, isa, primary_act, PostParse,
signature, preConditions, and score slots. Subsequent bullet items in
this section describe the contents of these slots.
2. Assign the frame to a slot, variable, or constant that is the name of the task
template.
3. Place a string in the
value slot that identies the task that this template denes.
4. Place the
'task_template symbol in the isa slot.
5. Place the name of the slot or variable dening your primary action in the
primary_act slot.
6. Place the name of the slot, variable or constant dening your
PostParse
method in the
PostParse slot.
7. Place in the
signature slot an array of the names of all action and target
templates required to complete this task.
8. Place an array of symbols in the
preConditions slot that species the names
of slots the Assistant must create to hold frames built from the templates
specied in the
signature array. The preConditions and signature
arrays must have the same number of elements. Furthermore, the symbols in the
preConditions array must appear in the same ordinal position as their
counterparts in the
signature array; that is, the rst element of the
Seitenansicht 663
1 2 ... 659 660 661 662 663 664 665 666 667 668 669 ... 941 942

Kommentare zu diesen Handbüchern

Keine Kommentare