Apple Newton Utilities Guide de l'utilisateur Page 846

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 845
CHAPTER 23
Endpoint Interface
23-18 Using the Endpoint Interface
Handling Normal Termination of Input 23
The InputScript message is sent to the input spec frame when one of the
termination conditions is met. You dene the
InputScript method in the input
spec frame.
The received data is passed as a parameter to the
InputScript method. Another
parameter describes the specic condition that caused the input to terminate, in
case you had specied more than one in the input spec.
When the
InputScript method returns, the system automatically posts another
receive request for you using the same input spec as the last one. You can prevent
this by calling
SetInputSpec within the InputScript method. In the
SetInputSpec method, you can set a different input spec, or you can prevent a
new input spec from being posted by setting the
inputSpec parameter to nil. Note
that while the input spec is
nil, incoming data may be lost.
Periodically Sampling Incoming Data 23
You can sample the incoming data without meeting any of the termination
conditions by specifying a
PartialScript method in the input spec. The system
sends the
PartialScript message to the input spec frame periodically, at the
frequency you dene in the
partialFrequency slot in the input spec, as long as
there are one or more bytes of data in the input buffer. The system passes to the
PartialScript method all of the data currently in the input buffer, but the data
is not removed from the input buffer. If you want to remove this data from the input
buffer, you can call the
FlushPartial method.
Note that the sending of
PartialScript messages is controlled by system idle
events and is in no way triggered by receive request completions. The current input
spec remains in effect after the
PartialScript method returns.
You typically would use a
PartialScript method to detect abnormal or
out-of-band data not found by any of the usual input termination conditions.
You can specify
PartialScript methods only for those input data forms that
allow termination conditions —specically, the
'string and 'bytes data forms.
To use the
PartialScript method, you must also include the
partialFrequency slot in the input spec. The partialFrequency slot
species the frequency, in milliseconds, at which the input data buffer should be
checked. If new data exists in the buffer, the
PartialScript message is sent to
the input spec frame.
Vue de la page 845
1 2 ... 841 842 843 844 845 846 847 848 849 850 851 ... 941 942

Commentaires sur ces manuels

Pas de commentaire