FormCalc Syntax Error Tips

FormCalc has a few possible syntax errors, and they aren’t always easy to decipher. Here’s a tip for when you get the “Syntax error near token ‘%1′ on line %2, column %3.”:

Generally, %1 will contain the token (word) nearest to the error. Please note that the token is not necessarily incorrect, and does not necessarily have anything to do with the error, other than proximity to the problem.

var b = abc(1)
if (b ne 1) then
//comment

The script above will generate a 7008 error: “Syntax error near token ‘then’ on line on line x, column y.” The actual error in this case is that the ‘endif’ token is missing from the script. The last correct token is ‘then’ (comments do not count as tokens.)

The way to fix this problem would be to add an ‘endif’ statement to the end of the script.

Learning Resources is putting together more extensive documentation for the syntax error messages which will hopefully be available on the Web shortly after we ship 8.2.