Adobe ColdFusion 8

CFML syntax errors

Problem: You get an error message such as the following:

Encountered "function or tag name" at line 12, column 1.
Encountered "\"" at line 37, column 20. 
Encountered "," at line 24, column 61. 
Unable to scan the character '\"' which follows "" at line 38, column 53. 

These errors typically indicate that you have unbalanced <, ", or # characters. One of the most common coding errors is to forget to close quoted code, number sign-delimited variable names, or opening tags. Make sure the code in the identified line and previous lines do not have missing characters.

The line number in the error message often does not identify the line that causes the error. Instead, it identifies the first line where the ColdFusion compiler encountered code that it could not handle as a result of the error.

Problem: You get an error message you do not understand.

Make sure all your CFML tags have matching end tags where appropriate. It is a common error to omit the end tag for the cfquery, cfoutput, cftable, or cfif tag.

As with the previous problem, the line number in the error message often does not identify the line that causes the error, but the first line where the ColdFusion compiler encounters code that it could not handle as a result of the error. Whenever you have an error message that does not appear to report a line with an error, check the code that precedes it for missing text.

Problem: Invalid attribute or value.

If you use an invalid attribute or attribute values, ColdFusion returns an error message. To prevent such syntax errors, use the CFML Code Analyzer. Also see Using the cftrace tag to trace execution.

Problem: You suspect that there are problems with the structure or contents of a complex data variable, such as a structure, array, query object, or WDDX-encoded variable.

Use the cfdump tag to generate a table-formatted display of the variable's structure and contents. For example, to dump a structure named relatives, use the following line. You must surround the variable name with number signs (#).

<cfdump var=#relatives#>