Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 11054 invoked from network); 13 Sep 2002 15:04:51 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 13 Sep 2002 15:04:51 -0000 Received: (qmail 28778 invoked by uid 97); 13 Sep 2002 15:04:22 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 28746 invoked by uid 97); 13 Sep 2002 15:04:21 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 28707 invoked by uid 98); 13 Sep 2002 15:04:20 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) From: "Geoff Meakin" To: "Ant Users List" Subject: RE: If anybody is interested.. [foreach] task which doesnt run out of memory. Date: Fri, 13 Sep 2002 16:03:39 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 In-Reply-To: <20020913135925.86329.qmail@web20416.mail.yahoo.com> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > > > > > > > > In the example here, the value of the property ${srcfile} will be changed everytime the loop iterates. It isn't reset at the end of the loop (I thought about doing that) as the property might still be useful outside the foreach2 task, and there is no real reason to reset it, as that would give the property scope, and properties generally dont have scope in ANT. The ANT API still allows you to easily modify property values, even if this functionality has been taken away from and , so it uses that mechanism to change the value of the property. Also- there really isnt a concept of "params" as such, as there was before (i.e. passing multiple properties to the called anttask)- because no target is being AntCalled.. The nested tasks have the same environment as the foreach task so they can access anything which is available. As an alternative example, the code: Will produce the following output: Letter a Letter b Letter c Letter d Letter e And is in effect the same as doing: (if allowed you to override the previous value that is (like in ANT1.4)) This is because each time the task is run, (one for each letter in the list), the value of the property ${letter} is equal to whichever letter in the list is being dealt with. Does this help at all? Cheers -Geoff >This sounds good, but how do you handle params? Are >you changing properties to do this and then unsetting >them at the end of the loop, or what? -- To unsubscribe, e-mail: For additional commands, e-mail: