These errors occur when the program list is formally incorrect. That prevents a program to be loaded into the runner.
Error | Description |
---|---|
EXTRA ARGUMENT | Parsing the arguments of an otherwise valid instruction, there are more characters in the line. Likely cause is that the final expression is correctly readable up to the point where there is an error; or a forgotten colon? |
DUPLICATE LABEL | A label with the same name was already placed at a point before this. |
REFERENCE EXPECTED | In an assignment (FOR, NEXT, LET, INPUT, READ, GET or PULL) instruction the argument does not conform the format of [Names]. |
DEF SYNTAX | In a DEF instruction, the name of the function does not conform the format of [Names]. |
SYNTAX | The instruction expects a certain symbol (equals sign, comma, parenthesis) or keyword (TO, STEP, THEN; GOTO/GOSUB after ON; or, abbreviation thereof) that is not found where expected. |
PARSE | String literal's double quote missing its pair. |
INSTRUCTION EXPECTED | The instruction should either start with the instruction keyword, or be formatted like an implicit LET assignment: name = expression. |
Some errors occur when the program is already running.
Error | Description | Recovery in Failsafe Mode |
---|---|---|
NEXT WITHOUT FOR | Encountering a FOR instruction, the runner pushes a loop structure on the stack of loops. Encountering a NEXT, it pops. This error occurs when the stack is empty when the NEXT is encountered. | Program Restart |
LOOP MISMATCH | NEXT instruction specified the name of the loop counter but on the loop stack top, a loop with a different counter is found. | Iterate the loop on the stack top |
DIM OVERDEFINES DEF | At a DIM instruction: there is a function defined with the name of the array being defined here. | The name will refer to the function where applicable |
OUT OF DATA | READ instruction tried to fetch the next item defined in the DATA instructions, but it passed the last item of the whole program. | Assign empty string |
LABEL DOES NOT EXIST | GOTO, GOSUB or RESTORE instruction refers to a label that is nowhere placed using any @ instruction. | RESTORE: restore to starting position GOTO/GOSUB: Program Restart |
NO DATA AT LABEL | RESTORE instruction refers to a label that is placed before some instruction other than DATA. | Restore to starting position |
CALL MISMATCH | Each time the runner encounters GOSUB, it pushes the label in the argument to the stack. Here RETURN instruction specified a label that does not match the label on the top of the stack. | Return to the address on the top of the stack |
RETURN WITHOUT GOSUB | RETURN instruction is encountered when the stack is empty. May well have been emptied by an extra RETURN or a PULL instruction. | Program Restart |
DEF OVERDEFINES DIM | At a DEF instruction: there is an array defined with the name of the function being defined here. | The name will refer to the function where applicable |
DIVIDE BY ZERO | / or MOD operator encountered with a value equal to 0 on the argument stack top | / operator: evaluates to Number.MAX_VALUE MOD: evaluates to empty string |
ILLEGAL EXPRESSION | In the process of evaluating an expression, the JavaScript implementation of a calculation returns the NaN value as the intermediate result. | Evaluate to empty string |
NO VALUE | Evaluating a reference to a variable, by that name none is initialized. Or, evaluating a reference to an array element when no array by that name is defined, or element not initialized. | Evaluate to empty string |
INVALID REFERENCE | In assignment (FOR, NEXT, LET, implicit LET, INPUT, READ, GET or PULL) the reference was neither a variable nor an array element. Often because it is a function. | Forget the value and run on |
While programming, error messages are essential information. The program better stops running as soon as possible if an error occurs, so the programmer can tell where the root cause is - and correct the program there. This is called debug mode or failfast mode.
But when a user who is not familiar with the program design sees those error messages, they can do little with it. Therefore there is a failsafe mode, in which there are no run time error messages, the program keeps recovering from errors.
The failsafe mode will be effective when you download your program from the Misc. tab and publish it.
Anonymous