• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Conditional assignment

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to translate this statement to ant task -
If a particular variable "test_var" has the value "X", set the value of another variable called "my_var" to "ABC". If its not "X", then assign "DEF" to "my_var".
I've tried something like this -
<property name="my_var" value="DEF" /> (by default)
the above is a global variable.
<target name"init">
<condition property="check">
<contains string="$test_var" substring="X" casesensitive="no"/>
</condition>
After this, I'm stuck! Depending on the value of "check", I should set my_var to some value. And I donno how to do it.
Please help me. This is urgent to me.
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic