Files
UnrealEngineUWP/Engine/Documentation/Source/Programming/Development/BuildGraph/ScriptAnatomy/Conditions/BuildGraphScriptConditions.INT.udn
Richard Hinckley 0049c28971 #jira UEDOC-3299
Shelved response to BenM's SME review comments. There was some shuffling of content, so I'm leaving this for RobertG to have a chance to confirm that this is acceptable. (Submitting as per SeanG's comment on the JIRA.)
#codereview robert.gervais

[CL 3102857 by Richard Hinckley in Main branch]
2016-08-26 13:24:06 -04:00

73 lines
3.8 KiB
Plaintext

Availability: Docs
Title: BuildGraph Script Conditions
Crumbs: %ROOT%, Programming, Programming/Development, Programming/Development/BuildGraph, Programming/Development/BuildGraph/ScriptAnatomy
Description:Learn the syntax needed to write BuildGraph script conditions.
version: 4.13
parent:Programming/Development/BuildGraph
type:Reference
related: Programming/Development/BuildGraph/ScriptAnatomy
tags:BuildGraph
[VAR:TopicCompact]
[OBJECT:TopicCompact]
[PARAM:image]
![%Programming/Development/BuildGraph/ScriptAnatomy/Conditions%](conditional_topic.png)
[/PARAM]
[PARAM:icon]
![](%ROOT%/reference_icon.png)(convert:false)
[/PARAM]
[PARAM:title]
%Programming/Development/BuildGraph/ScriptAnatomy/Conditions:title%
[/PARAM]
[PARAM:description]
%Programming/Development/BuildGraph/ScriptAnatomy/Conditions:description%
[/PARAM]
[PARAM:path]
[RELATIVE:Programming/Development/BuildGraph/ScriptAnatomy/Conditions]
[/PARAM]
[/OBJECT]
[/VAR]
[TOC(start:1 end:3)]
[EXCERPT:BuildGraphScriptConditions]
If you want to build logical complexity into your BuildGraph scripts, you'll need to work with conditionals. The following
section introduces you to how BuildGraph conditions are written, including a list of conditional operators.
## Conditions
BuildGraph script conditions consist of atoms and operators that evaluate to `true` or `false`.
### Atoms
Atoms can be numbers, strings, or identifiers that are coerced to their appropriate type for the oprator using them.
Atoms may be quoted with single (') or double (") quotes. They can also be an unquoted sequence of letters, digits, and
underscore characters. All atoms are considered the same type, regardless of how they're declared. Additionally, atoms are considered
case-insensitive for comparisons, which means that the strings "True" and 'true' are identical to the identifier `true`
(despite the presence of quotes and differences in case).
## Operators
A list of operators is specified below:
| **Operator** | **Description** | **Precedence** |
| ----------------------- | --------------------------------------------------------------------------- | --------------- |
| **(x)** | Subexpression | 1 |
| **!x** | Not operator | 1 |
| **Exists(x)** | True if the x file exists. | 1 |
| **HasTrailingSlash(x)** | True if x ends with a slash or backslash. | 1 |
| **x == y** | Tests two atoms for equality (case insensitive). | 2 |
| **x != y** | Tests two atoms for inequality (case insensitive). | 2 |
| **x < y** | Compares whether the integer x is less than the integer y. | 2 |
| **x <= y** | Compares whether the integer x is less than or equal to the integer y. | 2 |
| **x > y** | Compares whether the integer x is greater than the integer y. | 2 |
| **x >= y** | Compares whether the integer x is greater than or equal to the integer y. | 2 |
| **x and y** | True if both arguments are `true`. | 3 |
| **x or y** | True if either argument is `true`. | 4 |
[REGION:note]
The `'<'` and `'>'` characters must be escaped as `"&lt;"` and `"&gt;"` in XML.
[/REGION]
[/EXCERPT:BuildGraphScriptConditions]