Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 59344 invoked from network); 24 Jul 2007 13:16:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jul 2007 13:16:18 -0000 Received: (qmail 14891 invoked by uid 500); 24 Jul 2007 13:16:14 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 14855 invoked by uid 500); 24 Jul 2007 13:16:13 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 14838 invoked by uid 99); 24 Jul 2007 13:16:13 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2007 06:16:13 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [24.116.0.227] (HELO S1.cableone.net) (24.116.0.227) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2007 06:16:11 -0700 Received: from [192.168.99.7] (unverified [69.92.254.49]) by S1.cableone.net (CableOne SMTP Service S1) with ESMTP id 116274862 for ; Tue, 24 Jul 2007 06:15:48 -0700 Message-ID: <46A5FC6E.3080006@grafidog.com> Date: Tue, 24 Jul 2007 07:19:42 -0600 From: Dale Anson User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: Ant Users List Subject: Re: AW: random number generator References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-IP-stats: Incoming Outgoing Last 1, First 164, in=294, out=38, spam=0 Known=true X-External-IP: 69.92.254.49 X-Abuse-Info: Send abuse complaints to abuse@cableone.net X-Virus-Checked: Checked by ClamAV on apache.org Yet another option, use the math task from antelope (http://antelope.tigris.org). Here's an example from the docs: a random number between 0 and 100: ${result} Dale Jan.Materne@rzf.fin-nrw.de wrote: > > > > > > Jan > > >> -----Urspr�ngliche Nachricht----- >> Von: Mario Madunic [mailto:hajduk@imag.net] >> Gesendet: Samstag, 21. Juli 2007 16:25 >> An: Ant Users List >> Betreff: Re: random number generator >> >> Thank you Gilbert, >> >> it works like a charm. >> >> Mario >> >> Quoting Gilbert Rebhan : >> >> >>> Hi, >>> >>> Mario Madunic wrote: >>> >>>> Hi, >>>> >>>> I'm trying to generate a random number to be used as a >>>> >> temporary directory >> >>> name >>> >>>> through a multi step xslt process. I'm using Ant 1.6.5 and >>>> >> Java 1.6.0-b105 >> >>>> I receive the following error >>>> >>>> [random] Jul 20, 2007 9:11:27 PM org.apache.bsf.BSFManager exec >>>> [random] SEVERE: Exception : >>>> [random] java.security.PrivilegedActionException: >>>> org.apache.bsf.BSFException: JavaScript Error: Internal Error: >>>> org.mozilla.javascript.EcmaError: ReferenceError: "self" >>>> >> is not defined. >> >>> if you're already use BSF with >>> >>> >>> >>> >>> $${myrand} == ${myrand} >>> >>> >>> >>> main: >>> [echo] ${myrand} == 718 >>> BUILD SUCCESSFUL >>> Total time: 1 second >>> >>> Just put an integer to the Kernel#rand method. >>> If you want a floating point number, just use >>> rand without (integer) = >>> >>> >>> >>> >>> Regards, Gilbert >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >>> For additional commands, e-mail: user-help@ant.apache.org >>> >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >> For additional commands, e-mail: user-help@ant.apache.org >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org