
220
Chapter 11: Keywords
Example
This statement changes the second line of the field cast member Review Comments to “Reviewed
by Agnes Gooch”:
put "Reviewed by Agnes Gooch" into line 2 of member("Review Comments")
The same can be accomplished with a text cast member using this syntax:
put "Reviewed by Agnes Gooch" into member("Review Comments").line[2]
See also
char...of
,
item...of
,
line...of
,
paragraph
,
word...of
,
put...before
,
put...after
,
set...to, set...=
repeat while
Usage
-- Lingo syntax
repeat while
testCondition
statement(s)
end repeat
Description
Keyword; repeatedly executes
statement(s)
so long as the condition specified by
testCondition
is
TRUE
. This structure can be used in Lingo that continues to read strings until
the end of a file is reached, checks items until the end of a list is reached, or repeatedly performs
an action until the user presses or releases the mouse button.
While in a repeat loop, Lingo ignores other events. To check the current key in a repeat loop, use
the
keyPressed
property.
Only one handler can run at a time. If Lingo stays in a repeat loop for a long time, other events
stack up waiting to be evaluated. Therefore, repeat loops are best used for short, fast operations or
when users are idle.
If you need to process something for several seconds or more, evaluate the function in a loop with
some type of counter or test to track progress.
If the stop condition is never reached or there is no exit from the repeat loop, you can force
Director to stop by using Alt+period (Windows) or period (Macintosh).
Example
This handler starts the timer counting, resets the timer to 0, and then has the timer count up to
60 milliseconds:
on countTime
_system.milliseconds
repeat while _system.milliseconds < 60
-- waiting for time
end repeat
end countTime
See also
exit
,
exit repeat
,
repeat with
,
keyPressed()
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...