![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|||||
|
|
|||||
| built-in variable | #item | ||||
| Related Syntax | Related Concepts | ||||
Purpose
A built-in counter that contains the index of the current iteration of a repeat over loop.
#item can be used in numeric expressions or in format items that format counters.
The#item counter always provides a value of 1 for its first iteration and the number of opened elements for its last iteration. This occurs even if the "reversed" option is used because#item never counts back to 1.
As a predefined shelf, #item is "read-only" and may only be passed as a read-only argument.
Usage example:
local switch flags variable
...
repeat over flags
do select #item
case 1
output "1st flag is "
case 2
output "2nd flag is "
case 3
output "3rd flag is "
case 4 to 20
output "%d(#item)the flag is "
else
output "Flag number %d(#item) is "
done
do when flags
output "on.%n"
else
output "off.%n"
done
again
|
Related Syntax repeat over |
Related Concepts Loop indices |
| ---- |