TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

#foreach, #regex and #break

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
F-3000



Joined: 06 Dec 2010
Posts: 66
Location: Next to polarbear

PostPosted: Fri Jul 20, 2012 10:09 am    Post subject: #foreach, #regex and #break Reply with quote

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;
}

Code:
test
e



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)
Back to top
View user's profile Send private message Visit poster's website AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Jul 20, 2012 7:53 pm    Post subject: Reply with quote

I'll look into it, but probably not something that's easily fixed.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group