ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to Comes out f the FOR loop

Post new topic  Reply to topic
 How to Comes out f the FOR loop « View previous topic :: View next topic » 
Author Message
vijayakumar
PostPosted: Wed Nov 28, 2012 2:50 am    Post subject: How to Comes out f the FOR loop Reply with quote

Centurion

Joined: 01 Aug 2010
Posts: 101

I m using the FOR Looop and inside that i am using IF loop. If a particular condition matches, i need to comes out of the both IF and FOR loop.

How to do this?
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Wed Nov 28, 2012 3:01 am    Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi,

I assume that you are using ESQL. At which version your broker runs?
Did you for example try to find answer from InfoCenter?

--
Marko
Back to top
View user's profile Send private message Visit poster's website
mqsiuser
PostPosted: Wed Nov 28, 2012 3:20 am    Post subject: Re: How to Comes out f the FOR loop Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

vijayakumar wrote:
I m using the FOR Looop and inside that i am using IF loop. If a particular condition matches, i need to comes out of the both IF and FOR loop.

How to do this?


Set the condition(s) so that the IF(-statement) and FOR(-loop) stop.

e.g.
You FOR-loop is from x=1 to 10: SET x = 11;
Your IF checks for IF a != "xyz": SET a = "xyz";

Or use a WHILE-loop
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
polydegmon
PostPosted: Wed Nov 28, 2012 5:12 am    Post subject: Reply with quote

Novice

Joined: 07 Oct 2011
Posts: 11

You can use the LEAVE statement with a WHILE loop, but it can't be used with a FOR loop.

Code:

Check : WHILE <Condition>
            
   IF <Condition> THEN
      LEAVE Check;         
   END IF;
   
END WHILE;


There's no way I know of to jump out of a FOR AS loop, it will itterate through to the end regardless of what statements you put inside it to limit processing.
Back to top
View user's profile Send private message
mgk
PostPosted: Wed Nov 28, 2012 8:11 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
There's no way I know of to jump out of a FOR AS loop


If you wrap the FOR in a BEGIN ... END block, this block can also have a label and you can then LEAVE to the outer BEGIN .. END block...


Kind regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to Comes out f the FOR loop
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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.