[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Breaking out of a foreach loop
From: |
Mike Gibson |
Subject: |
Re: Breaking out of a foreach loop |
Date: |
Fri, 27 Feb 2004 16:50:48 -0700 |
User-agent: |
KMail/1.5.1 |
Here's a first pass...Not tested as I don't care that much.
restwords = $(wordlist 2,$words($(1)),$(1))
# $(1) : word list
# $(2) : break function
# $(3) : statement
for_with_break = $(if $(call $(2),$(firstword $(1))),
$(3) $(call f,$(call wordlist,$(1))))
$(call for_with_break,$(DIRS),some condition function,some statement)
On Friday 27 February 2004 03:45 pm, Bhatt, Milan C wrote:
> Hi Guys,
>
> I just had a quick question on whether there was any way to break out of
> a foreach loop when a certain condition has been reached.
>
> I'd like to do the following:
>
> $(foreach dir, $(DIRS), \
> $(if <condition>, <statement>; \
> <break_out_of_loop>) )
>
> I wasn't able to find anything in the documentation that provided this
> kind of functionality.
>
> Thanks,
> Milan