Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.
repeat with variableName = ¬
integer1 to integer2
statements
end repeat
repeat with variableName = ¬
integer1 down to integer2
statements
end repeat
The statements in a repeat with
structure repeat until a variable with an initial value of integer1
is greater than (or, in the case of down to
, less than) the number integer2
.
The value of the variable increases (or decreases) by 1 during each iteration of the repeat
loop.
If HyperCard executes an exit repeat
statement in the
loop, it continues running the handler starting from the first statement after end repeat
. If HyperCard executes a next repeat
statement, it returns immediately to the beginning of the repeat
loop and increases (or decreases) the value of the variable.
on mouseUp
show bkgnd field "demo field"
put return & spaces(25) & "Counting down to 0: 10" ¬
into bkgnd field "demo field"
repeat with theCount = 10 down to 0
put theCount into last word of bkgnd field "demo field"
wait 15 ticks
end repeat
flash
wait 20
hide bkgnd field "demo field"
put empty into bkgnd field "demo field"
end mouseUp
index
N
cardNumber
total
put "Hello world" -- built-in command
get total(field 1) -- function call
global HelpInfo -- keyword
Keywords
Version 0.7b1 (March 24, 2022)