Program termination: Difference between revisions
→{{header|AppleScript}}: Corrected existing entry.
(add task to ARM64 assembly Raspberry Pi) |
(→{{header|AppleScript}}: Corrected existing entry.) |
||
Line 151:
=={{header|AppleScript}}==
Contrary to what was stated in the previous entry here, AppleScript's "User canceled." error (number -128) stops the script execution immediately and does ''not'' cause a dialog to appear. (There may have been dialog at some point in the past owing to a bug in one of the earlier systems.) However, the error can be trapped if required and a specified action taken.
end run</lang>▼
If the script's running as an applet, the applet will quit as soon as the script stops — unless it's a stay-open applet, in which case it will be necessary to use a <code>quit</code> command instead of, or immediately before, the error command.
The memory used belongs to the application running the script and is reclaimed automatically.
<lang applescript> if (someCondition) then error number -128</lang>
In a stay-open applet:
<lang applescript>on idle -- A stay-open applet's 'idle' handler is called periodically while the applet remains open.
-- Some code, including:
if (someCondition) then
quit -- Quit the applet when the script stops executing.
error number -128 -- Stop executing the script. (Not necessary on recent systems.)
end if
return 10 -- Number of seconds to the next call of this handler if the applet's still open.
=={{header|ARM Assembly}}==
|