-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathcontrol.html
More file actions
221 lines (221 loc) · 5.66 KB
/
Copy pathcontrol.html
File metadata and controls
221 lines (221 loc) · 5.66 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta content="App Inventor for Android" name="description" />
<meta content="Android, Blocks App Inventor, Mobile, Phone, IDE" name="keywords" />
<title>
Control Blocks - App Inventor for Android
</title>
<link href="/static/images/appinventor-16.png" rel="SHORTCUT ICON" type="image/ico" />
<link href="/static/images/appinventor-16.png" rel="icon" type="image/png" />
<link href="/static/css/appinventor.css" rel="stylesheet" />
<script src="http://www.google.com/js/gweb/analytics/autotrack.js">
</script>
<script>
var tracker = new gweb.analytics.AutoTrack({
profile: 'UA-5856106-2'
});
</script>
<script language = "JavaScript" src="/static/scripts/HeaderAndFooter.js"></script>
<link href="test.css" rel="stylesheet" />
<style>
img.c2 {border-width:0}
div.c1 {clear:both;}
</style>
</head>
<body>
<script language = "JavaScript">createHeader('<div id="navigation-breadcrumb"> <a href="/learn/">Learn</a> > <a href="/learn/reference/">Reference</a> > Control Blocks > ');</script><br>
<div id="aiac">
<div class="main-container">
<div class="customhr customhr-gray">
</div>
<div class="content">
<div class="content-body">
<div class="learn-page">
<h1>
Control Blocks
</h1>
<ul>
<li>
<a href="#if">
if
</a>
</li>
<li>
<a href="#ifelse">
ifelse
</a>
</li>
<li>
<a href="#choose">
choose
</a>
</li>
<li>
<a href="#foreach">
foreach
</a>
</li>
<li>
<a href="#forrange">
for range
</a>
</li>
<li>
<a href="#while">
while
</a>
</li>
<li>
<a href="#getstarttext">
get start text
</a>
</li>
<li>
<a href="#closescreen">
close screen
</a>
</li>
<li>
<a href="#closescreenwithresult">
close screen with result
</a>
</li>
</ul>
<h2 id="if">
if
</h2>
<img alt="" src="images/if.png" />
<p>
Tests a given condition. If the condition is true, performs the actions in a given
sequence of blocks; otherwise, the blocks are ignored.
</p>
<h2 id="ifelse">
ifelse
</h2>
<img alt="" src="images/ifelse.png" />
<p>
Tests a given condition. If the result is true, performs the actions in the
<code>
then-do
</code>
sequence of blocks; otherwise, performs the actions in the
<code>
else-do
</code>
sequence of blocks.
</p>
<h2 id="choose">
choose
</h2>
<img alt="" src="images/choose.png" />
<p>
Tests a given condition. If the condition is true, performs the actions in the
<code>
then-do
</code>
sequence of blocks and returns the
<code>
then-return
</code>
value; otherwise, performs the actions in the
<code>
else-do
</code>
sequence of
blocks and returns the
<code>
else-return
</code>
value.
</p>
<h2 id="foreach">
foreach
</h2>
<img alt="" src="images/foreach.png" />
<p>
Runs the blocks in the
<code>
do
</code>
section for each item in the list
<code>
in
list
</code>
. Use the given variable name to refer to the current list item.
</p>
<h2 id="forrange">
for range
</h2>
<p>
Runs the block in the
<code>
do
</code>
section for each numeric value in the range
from start to end, stepping the value each time. Use the given variable name to
refer to the current value.
</p>
<h2 id="while">
while
</h2>
<img alt="" src="images/while.png" />
<p>
Tests the
<code>
test
</code>
condition. If true, performs the action given in
<code>
do
</code>
, then tests again. When
<code>
test
</code>
is false, the block ends.
</p>
<h2 id="getstarttext">
get start text
</h2>
<img alt="" src="images/getstarttext.png" />
<p>
Returns the text passed to this app when the app was started, if any.
</p>
<h2 id="closescreen">
close screen
</h2>
<img alt="" src="images/closescreen.png" />
<p>
Closes the app.
</p>
<h2 id="closescreenwithresult">
close screen with result
</h2>
<img alt="" src="images/closescreenwithresult.png" />
<p>
Closes the app and sets the variable APP_INVENTOR_RESULT to the given value.
</p>
</div>
</div>
</div>
<div class="footer">
<script language = "JavaScript">createFooter();</script><br>
<div class="footer-lastupdate">
<script>
if (document.lastModified != '') {
var m = "Page last updated: " + document.lastModified;
var p = m.length-8;
document.writeln("<center>");
document.write(m.substring(p, 0));
document.writeln("<\/center>");
}
</script>
</div>
</div>
</div>
</div>
</body>
</html>