NAnt SDK Documentation - v0.92

EnvironmentFunctions.VariableExists Method 

Gets a value indicating whether the specified environment variable exists.

[Visual Basic]
<Function(Name:="variable-exists")>
Public Shared Function VariableExists( _
   ByVal name As String _
) As Boolean
[C#]
[Function(Name="variable-exists")]
public static bool VariableExists(
   string name
);

Parameters

name
The environment variable that should be checked.

Return Value

true if the environment variable exists; otherwise, false.

Example

Execute a set of tasks only if the "BUILD_DEBUG" environment variable is set.

    
<if test="${environment::variable-exists('BUILD_DEBUG')}">
    ...
</if>
    
  

See Also

EnvironmentFunctions Class | NAnt.Core.Functions Namespace