kopia lustrzana https://github.com/backface/turtlestitch
1 wiersz
3.5 KiB
XML
1 wiersz
3.5 KiB
XML
<blocks app="Snap! 6, https://snap.berkeley.edu" version="1"><block-definition s="cases: if %'test' then %'result' %'more'" type="command" category="control"><comment w="262" collapsed="false">Multi-branched conditional.

If the first (Boolean) input is True, then the script in
the second (C-slot) input is run, and this block stops.

Additional tests can be added by putting one or more
ELSE IF blocks in the third (variadic) Boolean slot.
Use the arrowheads to get the number of Boolean
slots you need. Each ELSE IF block provides a Boolean
slot for a condition to test and a script slot for what to do
if the condition is True. You can put an ELSE block in
the last Boolean input to CASES for a script to run if
all the tests turn out False.

As soon as a condition is True, no further tests are done
and no further scripts are run.</comment><header></header><code></code><translations>pt:se _ , então _ _
</translations><inputs><input type="%b"></input><input type="%cs"></input><input type="%mult%boolUE"></input></inputs><script><block s="doIfElse"><block var="test"/><script><block s="doRun"><block var="result"/><list></list></block></script><script><custom-block s="catch %upvar %cs"><l>tag</l><script><block s="doForEach"><l>item</l><block var="more"/><script><block s="doIf"><block s="evaluate"><block var="item"/><list></list></block><script><custom-block s="throw %s"><block var="tag"/></custom-block></script></block></script></block></script></custom-block></script></block></script></block-definition><block-definition s="catch %'tag' %'action'" type="command" category="control"><header></header><code></code><translations>pt:captura _ _
</translations><inputs><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doCallCC"><block s="reifyScript"><script><block s="doSetVar"><l>tag</l><block var="cont"/></block><block s="doRun"><block var="action"/><list></list></block></script><list><l>cont</l></list></block></block></script></block-definition><block-definition s="throw %'cont'" type="command" category="control"><header></header><code></code><translations>pt:lança _
</translations><inputs><input type="%s">catchtag</input></inputs><script><block s="doRun"><block var="cont"/><list></list></block></script></block-definition><block-definition s="else if %'test' then %'action'" type="predicate" category="control"><comment w="176" collapsed="false">For use with the CASES block.
See its help message.</comment><header></header><code></code><translations>pt:senão, se _ , então _
</translations><inputs><input type="%b"></input><input type="%cs"></input></inputs><script><block s="doIfElse"><block var="test"/><script><block s="doRun"><block var="action"/><list></list></block><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block></script></block-definition><block-definition s="else %'action'" type="predicate" category="control"><comment w="176" collapsed="false">For use with the CASES block.
See its help message.</comment><header></header><code></code><translations>pt:senão, _
</translations><inputs><input type="%cs"></input></inputs><script><block s="doRun"><block var="action"/><list></list></block><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script></block-definition></blocks> |