|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Expanding Variables in if statementshi
I'm trying to check if a source string contains a substring, inside an <if> statement, but it doesn't seem to work when the source string is a variable I have: <property name="dir.base" value="this/is/my/working/directory" /> <if test="${string::contains('${dir.base}','working')}"> <echo>This is my directory</echo> </if> This never returns true. It doesn't seem to parse the ${dir.base} variable inside the <if> statement If I change the test to: <if test="${string::contains('${dir.base}','base')}"> <echo>This is my directory</echo> </if> This does return true. So, it appears to treat the variable as a literal and not a variable. Am I missing something? I tried removing the single quotes around ${dir.base} and got an error about the $ character. I also tried using double quotes, but got an error as well Is there a better way to check if a string (or path) contains a specific directory? thanks Michael ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ NAnt-users mailing list NAnt-users@... https://lists.sourceforge.net/lists/listinfo/nant-users |
|
|
Re: Expanding Variables in if statementsYou don't not embed expressions. Write your if as follows: <property name="dir.base"
value="this/is/my/working/directory" /> BOb From: Michael Corr
[mailto:michael@...] hi ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ NAnt-users mailing list NAnt-users@... https://lists.sourceforge.net/lists/listinfo/nant-users |
| Free embeddable forum powered by Nabble | Forum Help |