Mail to EE

EETransfer Off-line documentation

Back to summary
Updated 97/06/24 Try

Try to execute the "instruction" instruction.

- If it returns 'ok then execute the "ok" instruction, or if there is no "ok" instruction skip to the next instruction after the "try" instruction.
- If it returns 'warning then execute the "warning" instruction, or if there is no "warning" instruction propagate the 'warning to the first enclosing "try" instruction.
- If it returns 'error then execute the "error" instruction, or if there is no "error" instruction propagate the 'error to the first enclosing "try" instruction.
- If it returns 'cancelled then execute the "cancelled" instruction, or if there is no "cancelled" instruction propagate the 'cancelled to the first enclosing "try" instruction.

Note: Since "try" is a reserved NewtonScript keyword, it should be enclosed between "|".

Example of script fragment that sends an AT escape sequence (+++) to a modem, waits one seconds for an OK answer, and continues execution even if it doesn't receive the OK:

{

	toolSymbol: 'SendATEscape,

},

{

	toolSymbol: '|Try|,

	instruction: {

			toolSymbol: 'WaitForString,

			string: "OK" & unicodeCR & unicodeLF,

			timeout: 1000,

		},

	warning: 'ok,

},

// The following instructions will be executed even if a timeout has

// occured, because the timeout generates a 'warning which is handled

// by the "try" instruction and converted to a 'ok.

...

* cancelled
type: instruction
default value: nil

* error
type: instruction
default value: nil

* instruction
type: instruction
default value: nil

* warning
type: instruction
default value: nil
©1997 Easter-eggs
All trademarks mentioned are the property of their respective owners