Learning Haxe: Part 4: Conditional Statements

Learning Haxe

Haxe is a strongly-typed multi-paradigm programming language that also supports cross-platform compiling into many different source and byte-code languages such as ActionScript 3, JavaScript, Java, C++, C#, PHP, Python, Lua, and Node.js.


Conditional Statements

Haxe supports comparing two value using multiple operators.

  • ==: Equal
  • !=: Not equal
  • <: Less than
  • >: Greater than
  • >=: Greater than or equal to
  • <=: Less than or equal to

When using pairs of comparisons, Haxe also supports binary, logical operators.

  • &&: Logical AND
  • ||: Logical OR
  • !: Logical NOT

Syntax

Conditional statements start with an initial keyword of if and enclose their comparisons within parentheses. The code to run as a result is within open and closing curly brackets.

If… else if

Haxe supports the if.. else if pattern where an additional if-statement can be paired at the end.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.