Alle 16:20, martedì 18 aprile 2006, Brad King ha scritto: > Pino Toscano wrote: > > Hello, > > > > imagine I'm iterating using a foreach() like this: > > set(MY_OPTS "foo bar etc") > > foreach(OPT ${MY_OPTS}) > > # do something ... > > endforeach(OPT ${MY_OPTS}) > > > > is there a way to break the iteration, just like a break in C? > > > > Whether it exist, does it break even nested foreach()? > > This is not possible, but you can simulate it yourself: > > SET(OPT_DONE 0) > foreach(opt ${MY_OPTS}) > if(NOT OPT_DONE) > #...code... > if(..need to break..) > set(OPT_DONE 1) > endif(..need to break..) > endif(NOT OPT_DONE) > endforeach(opt)
That is not what I would like, as this would continue executing the loop. And if the foreach loop is inside another foreach loop, having to execute all the iterations is not my best plan... Regards, -- Pino Toscano
pgpOLXAP7sF31.pgp
Description: PGP signature
_______________________________________________ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem