An important point of the Interpreter from the beginning was to have detailed and extensive error messages, since that is the start of all debugging. Below is a list of all errors, in alphabetical order, in the following format.
· Error name
- Cause
- Fix
· Array length must be type int.
- Attempted to create an array whose length was not a number.
- The number of spaces in an array must be a countable number – int.
· Attempted to access illegal object. Name: {name}, Reason: {reason}
- The programmer decided this object should not be available for the Interpreter.
- There is no fix; contact the programmer if this is a mistake or there may be something else that was intended for that use.
· Cannot apply indexing with [] to an expression of type {type}
- Attempted to apply indexing to an object that was not a collection.
- Either used wrong object or the object needs to be declared as an array.
· Class member is not a field or property.
- Attempted to access something that the Interpreter is not equipped to handle.
- Either do without it or contact the Author (may become allowed in the next update).
· {class} does not contain a definition for {subclass}.
- When using the new keyword, make sure the Interpreter can see the object referenced. This can be done with ext.listMembers (subclasses will appear in the format namespace.mainclass+subclass, sometimes even more subclasses).
- Possible fixes may include checking for typos, making sure the class is public, or using the above example to check access.
· Condition did not evaluate to true or false
- Conditions must be true or false.
- See Keywords above for conditional statements, and operators or C# Reference for Boolean statements.
· Expected pair before
- The operator requires two operands, and one of them could not be found (specifically the first one).
- Make sure the expression does not start with the operator.
· Expected variable to set
- The expression began with an equals sign.
- Cannot assign to nothing.
· Field is constant or readonly.
- The programmer set the field to be unchangeable after initial instantiation.
- The field cannot change, use a local variable, or if necessary, persistence.
· Incorrect use of char (e.g. ‘a’)
- Single quotes were used without anything in them or too much in them.
- Make sure there is exactly one character between the single quotes.
· Index out of bounds (or similar)
- An array was accessed, but the index did not exist.
- Be aware the last index of arrays is one less than the length, otherwise be sure the index exists. Some collections have a helpful Keys property.
· Improper use of keyword ‘code’
- The code keyword was used without proper context. Specifically, it was used without anything after it.
- See Keywords above for directions on use.
· Improper use of keyword 'for'
- The for keyword was used without proper context.
- See Keywords above for directions on use.
· Improper use of keyword 'if'
- The if keyword was used without proper context.
- See Keywords above for directions on use.
· Improper use of keyword 'return'
- The return keyword was used without proper context.
- See Keywords above for directions on use.
· Improper use of keyword 'while'
- The while keyword was used without proper context.
- See Keywords above for directions on use.
· Multidimensional arrays of non-int indexes are not supported
- Attempted to access a multidimensional array with non-integer indexes.
- These are more complicated and are not currently supported.
· Null reference exception.
- This is cause by attempting to access or use in math a value that was empty.
- Assign the value, use a different value, or assign without math.
· Property is not readable.
- The programmer did not include a get function to the property.
- The property cannot be accessed directly. Check documentation to see if there is a preferred method.
· Property is not writable.
- The programmer did not include a set function to the property.
- The property cannot be changed directly. Check documentation to see if there is a preferred method.
· The expression cannot be written to
- The Interpreter was given an equals sign after an expression and the Interpreter did not know how to handle it.
- Make sure the expression is a variable or an accessible field or property.
· The given key was not present… (or similar)
- See Index out of bounds.
· The name {text} does not exist
- The Interpreter could not discern what the text meant.
- Check spelling, make sure the variable exists, or make sure the object is visible.
· The object does not contain a method/constructor with the given parameters…
- The Interpreter could not find a method/constructor that fit the parameters.
- The desired method/constructor could be hidden, the combination of parameter types may not exist; see Microsoft Docs (Method Signatures), or there may be a typo.
· Three operators in a row (add parentheses)
- The Interpreter cannot handle 3 operators in a row.
- See Operators above for a detailed fix.
· Too many chained parentheses. Break up into variables.
- The Interpreter puts a limit on parentheses within parentheses (like (this)).
- Break them up like var b = (this); like(b);
· Unbalanced double quotes.
- The code either has an extra double quote or is missing a double quote.
- Fix this by adding or removing a quote such that they all belong.
· Unbalanced single quotes.
- Same as the double quotes, just as single quotes.
· Unbalanced parentheses, missing {number}.
- There are missing closing parentheses.
- Add the missing closing parentheses.
· Unexpected closing parenthesis
- There is an extra closing parenthesis; the Interpreter will show where.
- Either remove the parenthesis shown or add a missing one before it.
· Unexpected closing bracket
- There is an extra closing bracket; the Interpreter will show where.
- Either remove the bracket shown or add a missing one before it.
· Unknown operator {text}
- The given operator is not defined.
- Make sure to use only operators defined in the Operators section above.
· Value expected
- When applying indexing with [], the brackets must not be empty.
- Provide a value in the brackets.
· Value has not yet been set. Use Parentheses to indicate order of operation.
- Some operators have high precedence, so they will be checked first.
- If the operator was intended, use parentheses to tell the Interpreter which operators should evaluate first; see Microsoft Docs (C# Operators).
There may be other errors generated by methods that are called, or by C# itself. In those cases, locate appropriate documentation (perhaps Microsoft Docs) if more information is required. Additionally, put the code in a Try method (see Extension above), and access the Exception’s other details. Also, if the exception occurred in one of the Interpreter’s methods (except the “error” method), please send the author a detailed bug report. If this document specifies a certain feature and use of that feature in its simplest form consistently generates one of the errors in the list above, please send the author a detailed bug report.
Next: Changelog