NinjaScript > Editor > Compile Error Codes >


Print this Topic Previous pageReturn to chapter overviewNext page

The following CS0665 error code information is provided within the context of NinjaScript. The examples provided are only a subset of potential problems that this error code may reflect. In any case, the examples below provide a reference of coding flaw possibilities.


Error Code Explanation

This error can occur when you mistake using assignment (=) instead of checking for equality (==).


Please ensure that you use (==) when checking if two objects are equal.


Error Description #1
Assignment in conditional expression is always constant; did you mean to use == instead of = ?


// Erroneous Sample Code - Incorrect since the expression is assigning a value of 'true' to the property Historical

if (Historical = true)
  // Do something


// Resolution Sample Code - Correct

if (Historical == true)
  // Do something