Forum Discussion
kimmyh51
14 years agoContributor
the attached is not the best example, but gives an idea of what I mean
In the attached screeenshot the syntax error is an "if, and" statement with no 'and' criteria or closing brackets etc.
Yet the error is not reported in the line that the syntax error is, or the one following.
I have had this happen where I get a little red X at the bottom of a page with up to 200 lines of code, and I have the x at the bottom and eventually find the syntax error, 100 lines or so above it. Usually in the form of a missing bracket. Often there are several functions bnetween the location of the little red x and the actual error.
The most common one will be where I have :
a script unit with say, 10 functions in it
function 3 has 3 if statements
the 3rd if statement has no closing parenthesis
and the red X is at the bottom of the script unit at the end of function 10
Id have thought it would at least be at the end of function 3 - or start of function 4 (does it not check when a new function statement is made, that all closing/opening parenthesis are present for declarations in the function immediately prior?)
In the attached screeenshot the syntax error is an "if, and" statement with no 'and' criteria or closing brackets etc.
Yet the error is not reported in the line that the syntax error is, or the one following.
I have had this happen where I get a little red X at the bottom of a page with up to 200 lines of code, and I have the x at the bottom and eventually find the syntax error, 100 lines or so above it. Usually in the form of a missing bracket. Often there are several functions bnetween the location of the little red x and the actual error.
The most common one will be where I have :
a script unit with say, 10 functions in it
function 3 has 3 if statements
the 3rd if statement has no closing parenthesis
and the red X is at the bottom of the script unit at the end of function 10
Id have thought it would at least be at the end of function 3 - or start of function 4 (does it not check when a new function statement is made, that all closing/opening parenthesis are present for declarations in the function immediately prior?)