F-3000
Joined: 06 Dec 2010 Posts: 63 Location: Next to polarbear
|
Posted: Fri Jul 20, 2012 10:09 am Post subject: #foreach, #regex and #break |
|
|
I found out, that #break doesn't work in combination of #foreach and #regex. Break gets executed, but foreach continues regardless.
As an example:
| Code: | #alias {test}
{
#var tmp {a;b;3;d;e};
#foreach {$tmp} {tmp2} {#regex {$tmp2} {3} {#break}}
#showme $tmp2;
} |
A way to round this, however:
| Code: | #alias {test}
{
#var tmp {a;b;3;d;e};
#var tmp3 0;
#foreach {$tmp} {tmp2} {
#regex {$tmp2} {3} {#var tmp3 1};
#if {$tmp3} {#break};
};
#showme $tmp2;
} |
(I'm using compiled 2.0.8) |
|