by
8,522 33
0
5
13k
15
Top 1% !
Popular
Famous
Pearl of Wisdom
Specified
Popularity: 282nd place
Created
Modified Sep 13, 2013
This snippet is Public
No tags for this snippet yet.
LanguageANT
LicenseMIT_X11

ANT: Dynamic Variables (properties with a variable name)

This is how we can prepare a variable, with a variable name
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/11189/ANT--Dynamic-Variables-(properties-with-?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
<!-- Dynamic variables --> <macrodef name="propertycopy"> <attribute name="name"/> <attribute name="from"/> <sequential> <property name="@{name}" value="${@{from}}"/> </sequential> </macrodef> <!-- USAGE --> <property name="bar.foo" value= "This is the composite var bar.foo" /> <property name="tmp" value= "bar" /> <propertycopy name="testVar" from="${tmp}.foo"/> <echo>${testVar}</echo> <!-- This will print: "This is the composite var bar.foo" -->
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus