CS0103

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Editor > Compile Error Codes >

CS0103

Previous page Return to chapter overview Next page

The following CS0103 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

When a variable is used before declaration, the compiler will not know what it is. This error is also commonly invoked by typos.

 

Please ensure that you have declared your variables prior to using them. If variables are declared or properties already exist, please check for typos.

 

Error Description #1
The name 'identifier' does not exist in the current context

 

Example #1

// Erroneous Sample Code - 'CurentBar' does not exist since it has been spelled incorrectly (missing an 'r')

if (CurentBar < 10)

 

// Resolution Sample Code - 'CurrentBar' exists since it is spelled correctly

if (CurrentBar < 10)

 

Example #2

// Erroneous Sample Code - 'newVariable' is not declared

newVariable = 10;

 

// Resolution Sample Code - 'newVariable' is now declared as an integer

int newVariable = 10;