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 pathcase.lcdoc
More file actions
77 lines (47 loc) · 1.97 KB
/
case.lcdoc
File metadata and controls
77 lines (47 loc) · 1.97 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Name: case
Type: keyword
Syntax: case <value>
Syntax: case <condition>
Summary:
Used within a <switch> <control structure> to designate one of the
possibilities to be handled.
Introduced: 1.0
OS: mac, windows, linux, ios, android
Platforms: desktop, server, mobile
Example:
case "A"
Example:
case myChar = "A"
Parameters:
value:
condition:
Description:
Use the <case> <keyword> to indicate the condition for which a set of
<statement|statements> should be <execute|executed>.
The <case> <keyword> can be used in two forms. The first form is used
when the <switch> <statement> includes an <expression> : the case is
<execute|executed> if the <value> after the <word> case is equal to the
expression in the <switch> <control structure>. For example, if the
<switch> <control structure|structure> starts with this <statement> :
switch thisVariable
then a <case> <statement> inside the <switch>
<control structure|structure> might look like this:
case 3
and the lines following the <case> <keyword> are executed if
thisVariable = 3. Use this form if you want to test a single value, and
do different things depending on what that <value> is equal to.
The second form is used when the <switch> <statement> does not include
an <expression> : the case is <execute|executed> if the <condition>
after the word case is true. For example, if the <switch>
<control structure|structure> starts with this <statement> :
switch
then a <case> <statement> inside the <switch>
<control structure|structure> might look like this:
case the short name of this card contains "a"
and the statements following the <case> <keyword> are <execute|executed>
if the <character> "a" appears in the <current card|current card's>
name.
References: switch (control structure), break (control structure),
value (function), keyword (glossary), current card (glossary),
statement (glossary), execute (glossary), control structure (glossary),
expression (glossary), word (keyword), character (keyword)