Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 534905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:39:39+00:00 2026-05-13T09:39:39+00:00

I am trying to figure out how to write a simple if condition in

  • 0

I am trying to figure out how to write a simple if condition in nant
that will evaluate to true when both x & y properties are true.

<project default="all">
    <property name="x" value="True" />
    <property name="y" value="True" />
    <target name="all">
        <echo message="x is True" if="${x}" />
        <echo message="y is True" if="${x}" />
        <echo message="x AND y are True" if="${x} AND ${y}" />
        <echo message="x AND y are True" if="${x} &amp;&amp; ${y}" />
    </target>
</project>

I cannot figure out the syntax for the x AND y echo message – I tried both AND and ‘&&’ and that doesn’t seem to work.(i keep getting error messages like : String was not recognized as a valid Boolean.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:39:39+00:00Added an answer on May 13, 2026 at 9:39 am

    You want to use if=”${x and y}”, where both x and y are in the same pair of brackets:

    <project default="all">
        <property name="x" value="true" />
        <property name="y" value="true" />
        <target name="all">
            <echo message="x is True" if="${x}" />
            <echo message="y is True" if="${y}" />
            <echo message="x AND y are True" if="${x and y}" />
    
        </target>
    </project>
    

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using NHibernate, and am trying to figure out how to write a
Working with Oracle 11g here. I'm trying to figure out how to write a
I'm trying to figure out why a simple query in LINQ is returning odd
I'm trying to figure out the best way to insert a record into a
I'm trying to figure out a way to get a Silverlight Client to be
I am trying to write specs for the posts/show.html.erb view of a simple application
I'm trying to figure out the best way to compress a stream with Python's
At work we have a web app that we'll need to interface with another
I am having some trouble with leading and trailing white space in a data.frame.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.