This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathcatch.lcdoc
More file actions
47 lines (33 loc) · 1.53 KB
/
catch.lcdoc
File metadata and controls
47 lines (33 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Name: catch
Type: keyword
Syntax: catch <errorParameter>
Summary:
Used within a <try> <control structure> to <handle> <error|errors>.
Introduced: 1.0
OS: mac, windows, linux, ios, android
Platforms: desktop, server, mobile
Example:
catch myError
Parameters:
errorParameter:
Description:
Use the <catch> <keyword> to <handle> <error|errors> <return|returned>
by a <handler> with the <throw> <control structure>.
When one of the statements in a <try> <control structure> causes an
<execution error>, the errorParameter is set to the error string, and
the <statement|statements> after the <catch> <keyword> are
<execute|executed>. If LiveCode generates the error (for example, an
<execution error> from a built-in <command>), the <errorParameter> is a
positive number. An error string can also be returned from a <handler>
by the <throw> <keyword>.
The statements after the <catch> <keyword> are only <execute|executed>
if there is an <error>. These <statement|statements> can refer to the
<value> of the <errorParameter>. For example, the <catch> section might
contain an <if> or <switch> <control structure>, which does different
things depending on the value of the <errorParameter>.
References: if (control structure), switch (control structure),
try (control structure), throw (control structure), result (function),
value (function), return (glossary), handle (glossary),
handler (glossary), execute (glossary), error (glossary),
statement (glossary), execution error (glossary), keyword (glossary),
control structure (glossary), command (glossary)