Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 72356 invoked by uid 500); 23 Aug 2001 21:06:35 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 72347 invoked from network); 23 Aug 2001 21:06:35 -0000 Message-ID: <20010823210639.91051.qmail@web11608.mail.yahoo.com> Date: Thu, 23 Aug 2001 14:06:39 -0700 (PDT) From: Edgar "S�nchez" Subject: Re: Making Jumps or doing Loops!! To: ant-user@jakarta.apache.org In-Reply-To: <20010823205215.10921.qmail@web13407.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Thank you Diane, and all you guys --- Diane Holt wrote: > And of course, right after I send it again, I > realize there's a d'oh! in > it -- the "doit" target actually does run 10 times, > not 9 (my parenthetic > about it not being zero-based is completely wrong, > since of course it is > zero-based, so 9 is the last number that gets echoed > out -- d'oh! :) > > Diane > > --- Diane Holt wrote: > > [Sorry if this ends up getting posted twice, but > it was the first one I > > sent, and I've yet to see it come through, so I'm > not sure if it really > > went out.] > > > > Actually, I'd take advantage of some of the new > stuff available in 1.4 > > (finally found some time to pick it up and start > trying things out :) -- > > namely, the new "inheritAll" attr for > and the new > > task, in conjunction with 's > incrementing functionality. > > For > > example: > > > > > > > > > > > > operation="+"/> > > > > > > > > arg2="${maxCount}"/> > > > > > > > > > > > > > > > > > > > > will "Do stuff here" 9 times (it's not zero-based > :) [Note: Make sure > > something removes counter.properties before the > "doit" target gets run.] > > > > Diane > > > > --- Don Taylor > wrote: > > > > > > --- Edgar S�nchez wrote: > > > > Thanks Don > > > > > > > > just a question. > > > > When you put the sample of the counter the > "." > > > > after the counter means that the value will > increment > > > > in one?? > > > > > > Not the value, the property name. I'm creating a > series of properties: > > > > > > counter > > > counter. > > > counter.. > > > counter... > > > > > > The value is whatever. > > > > > > -- Don > > > > > > > value="whatever" /> > > > > or how do I increment in one the variable > value of > > > > my counter? > > > > > > > > Thanks again > > > > VES > > > > > > > > > > > > --- Don Taylor > wrote: > > > > > > > > > > --- Edgar S�nchez > wrote: > > > > > > Hi everyone is Vincent again... > > > > > > > > > > > > now I've 2 questions, well those are > for the > > > > > same > > > > > > reason.. > > > > > > I was wondering if here in Ant could I > make some > > > > > > jumps in order to repeat the same > procedure with > > > > > other > > > > > > caracteristics, > > > > > > > > > > Yes, check out the antcall task. This allows > you to > > > > > execute the > > > > > same target multiple times with different > sets of > > > > > "inputs". > > > > > > > > > > > > > > > or if I can use loops like For or > > > > > > While to do the same, keeping a counter in > order > > > > > to > > > > > > make conditions to execute the same > procedure or > > > > > same > > > > > > target with diferent actions. > > > > > > > > > > > > Is it possible? > > > > > > > > > > When looping, you have to create a > "kick-out" > > > > > condition. I used the > > > > > target's unless attribute. The idea is to > loop until > > > > > the property is > > > > > set. However, because a target can't antcall > itself, > > > > > you have to > > > > > replicate the target and have them > cross-call each > > > > > other: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > unless="some.condition"> > > > > > > > > > > > > > > > > > > > > > > > > unless="some.condition"> > > > > > > > > > > > > > > > > > > > > > > > > > This takes care of while loops. I've never > tried > > > > > implementing a for > > > > > loop in Ant. I suppose you could do > something like > > > > > the following > > > > > in the worker target: > > > > > > > > > > > > > > > > > > > > > > > > > value="whatever" /> > > > > > > > > > > > > > > > Then if you wanted to loop 3 times: > > > > > > > > > > > > > > unless="counter..."> > > > > > > > > > > > > > > > > > > > > > > > > unless="counter..."> > > > > > > > > > > > > > > > > > > > > -- Don > > > > > > > > > > > thank you > > > > > > VES > > > > ===== > > (holtdl@yahoo.com) > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Make international calls for as low as $.04/minute > with Yahoo! Messenger > > http://phonecard.yahoo.com/ > === message truncated === ===== _________________________________________________________________ "Puedes sentirte desilusionado si fallas, pero est�s condenado si no lo intentas." "You can get disappointed if you fail down, but you are doomed if you do not try it." ICQ # 22338121 __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/