Casio Naurtech CETerm Ver.5.5 Scripting Guide Manual do Utilizador Página 29

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 164
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 28
NAURTECH WEB BROWSER AND TERMINAL EMULATION FOR WINDOWS CE AND WINDOWS MOBILE
CETerm Scripting Guide Page 29
this timer. The scriptExpression is a string containing the script, but is commonly
a function invocation, such as “myTimerFunction( 3, „alert‟ );”
Timers are especially useful with complex or long-running scripts. Interval timers
can be used to perform simple update tasks. One-time timers should be used in
preference to interval timers. In general, scripts should perform a short action
and exit. With a complex script such as a state-machine, the state can be
maintained in global variables and the script re-activated periodically to check for
state transitions and perform actions. See the “expect” script and
“ExpectMonitor” class in Section 5.1 for an example of the use of a timer.
status = SetProperty ( propertyName, propertyValue )
SetProperty will assign the given value to the named property. See Appendix 2
for a list of available properties. The returned status is 0 for success, non-zero
for failure.
SetScriptTimeout ( millisec )
Set the maximum script execution time. This value may be updated during a
running script. If updated, the new timeout will apply starting at the time of the
change. A value of 0 will disable the timeout.
The script timeout prevents a faulty script from locking-up CETerm. For
example, if a script enters an “endless loop”, the timeout will eventually force the
script to abort.
timeoutTimerID = SetTimeout ( scriptExpression, delayMillisec )
Set a one-time timer to execute the scriptExpression after a delay of
delayMillisec. This method returns an ID that should be saved in a global variable
for later use with ClearTimeout if needed. Other scripts may run while waiting for
this timer. The scriptExpression is a string containing the script, but is commonly
a function invocation, such as “myTimerFunction( 3, „alert‟ );”
Timers are especially useful with complex or long-running scripts. Timers can
also be used to defer an operation which is not possible within an event handler.
One-time timers should be used in preference to interval timers. In general,
scripts should perform a short action and exit. With a complex script such as a
state-machine, the state can be maintained in global variables and the script re-
activated periodically to check for state transitions and perform actions. See the
“expect” script and “ExpectMonitor” in Section 5.1 for an example of the use of a
timer.
Vista de página 28
1 2 ... 24 25 26 27 28 29 30 31 32 33 34 ... 163 164

Comentários a estes Manuais

Sem comentários