NWN2 Scripting.




Simulation Training.

Introduction
Home
First Program
Seeing Results
Variables and Data Types
Comments
Functions
Data Conversion
Random Numbers
Concatenation
Arithmetic Operators
Compound Assignments
One More or Less
Precedence
Relational Operators
The Open Branch
The Closed Branch
Logical AND
Logical OR
Compound Statements
ELSE If
Switch Case
The ? Operator
The for Loop
The while Loop
The do while Loop
Introduction to Functions
Passing Values
Passing Multiple Values
Multiple Functions
Simplifying Functions
TRUE/fALSE Conditions
Return Values
Setting Global Variables
Getting Global Variables
Setting Local Variables
Getting Local Variables
WayPoints Introduction
Static Waypoint Sets
Dynamic Waypoint Sets
Dynamic WP Cycles
Input Output

Relational Operators

Relational operators show the relationship between two quantities. The material presented here will be used as a foundation for hte material presented in the next section, where you discover how to create programs that iwll exhibt decision-making capabilities.


The Operators

A relational operator is a symbol that indicates a relationship between two quantities. These quantaties may be variables, constants, or functions. The important point about these relationships is that they are either TRUE, or FALSE - There is nothing in between!

The table below shows the relational operators and their meanings:

 

Symbol Meaning TRUE Examples FALSE Examples
Greater than. 5>3 3>5
>= Greater than or equal to. 10>=10 3>=5
Less than. 3<5 5<3
<=  Less than or equal to. 3<=10 10<=3
== Equal to. 8==8 5==3
!= Not equal to 8 !=5 7 !=7

 

Note that the equal to operator is == and not =. This is because the = is an assignment operator and does not mean equal. The no equal is != where the ! is sometimes called the bang.

 

Nwn2Scripting provides material for training only. We do not warrant the correctness of its contents. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 2008 by Adamson House, Ltd. All Rights Reserved.

Questions or Comments: EMail Webmaster

Donations are to Adamson House, Ltd who maintains this site.
All donations go the the improvement of this site.