Code: Select all
v9.90.0304 - 2011-02-13 11:26
+ Scripting: Added foreach loops. General syntax:
foreach($variable, listoftokens, [separator=|]) {
statement(s);
}
Remarks:
- $variable is the variable which receives the value of the next
token in each round of the loop. You can use a new variable or
an already used one, it does not matter.
- The last value of $variable remains even after the foreach
loop.
- listoftokens is a string of tokens, separated by a separator.
- The separator defaults to "|" (pipe), but can be set to
anything, also multi-character strings.
- Surrounding spaces are not trimmed off on each side of the
tokens.
- If listoftokens is nothing ("") the loop will still be
executed one time with $variable set to nothing.
- SC break and SC continue are supported.
Example 1:
// returns 3 strings (moon, sun, venus):
foreach($token, "moon,sun,venus", ",") {
echo $token;
}
Example 2:
// nested foreach loops
foreach($token, "a|b|c") {
foreach($token2, "1,2,3", ",") {
echo $token . $token2;
}
}
Example 3:
// selected list items
foreach($token, <get selecteditemspathnames |>) {
echo $token;
}
! Catalog: For a couple of versions newly added items defaulted to
colors Black on Black. Fixed.
It's a good idea to backup your complete XYplorer settings (menu File | Settings | Backup your Application Data Folder)
before running a new BETA version. This will also help in fixing any fresh bugs.
XYplorer Beta Club