adam1h
asked on
coldfusion syntax error
Hi experts,
I have a syntax error in these code but I can't see where.
The error shown is :
the line 341 is the line below
Do you have an idea ?
I have a syntax error in these code but I can't see where.
The error shown is :
Invalid CFML construct found on line 341 at column 23.
ColdFusion was looking at the following text:
;
<!--- get form's data & store into pages (cfc's) --->
<cfloop list="#variables.languages#" index="variables.lang">
<!--- get & store default language's data --->
<cfif variables.lang EQ application.languageByDefault>
<!--- title --->
<cfset variables["cfc_" & variables.lang].setTitle(evaluate('form.title_#application.languages["#variables.lang#"]#'))>
<cfset variables.defaultTitle = evaluate('form.title_#application.languages["#variables.lang#"]#')>
<!--- description --->
<cfset variables["cfc_" & variables.lang].setDescription(evaluate('form.description_#application.languages["#variables.lang#"]#'))>
<cfset variables.defaultDescription = evaluate('form.title_#application.languages["#variables.lang#"]#')>
<!--- keywords --->
<cfset variables["cfc_" & variables.lang].setKeywords(evaluate('form.keywords_#application.languages["#variables.lang#"]#'))>
<cfset variables.defaultKeywords = evaluate('form.title_#application.languages["#variables.lang#"]#')>
<!--- page's body --->
<cfset variables["cfc_" & variables.lang].setBody(evaluate('form.body_#application.languages["#variables.lang#"]#'))>
<cfset variables.defaultBody = evaluate('form.title_#application.languages["#variables.lang#"]#')>
<!--- save data to the database --->
<cfset entitySave(evaluate('variables.cfc_#variables.lang#'))>
<cfset ormFlush()>
<cfbreak>
</cfif>
</cfloop>
the line 341 is the line below
<!--- title --->:
<cfloop list="#variables.languages#" index="variables.lang">
<!--- get & store other language's data --->
<cfif variables.lang NEQ application.languageByDefault>
<!--- title --->
<cfset variables.valueToTest = evaluate('form.title_#application.languages["#variables.lang#"]#')>
<cfif variables.valueToTest NEQ "">
<cfset variables["cfc_" & variables.lang].setTitle(evaluate('form.title_#application.languages["#variables.lang#"]#'))>
<cfelse> <!--- this language's value is empty : store default language's value --->
<cfset variables["cfc_" & variables.lang].setTitle(variables.defaultTitle)>
</cfif>
<!--- description --->
<cfset variables.valueToTest = evaluate('form.description_#application.languages["#variables.lang#"]#')>
<cfif variables.valueToTest NEQ "">
<cfset variables["cfc_" & variables.lang].setDescription(evaluate('form.description_#application.languages["#variables.lang#"]#'))>
<cfelse> <!--- this language's value is empty : store default language's value --->
<cfset variables["cfc_" & variables.lang].setDescription(variables.defaultDescription)>
</cfif>
<!--- keywords --->
<cfset variables.valueToTest = evaluate('form.keywords_#application.languages["#variables.lang#"]#')>
<cfif variables.valueToTest NEQ "">
<cfset variables["cfc_" & variables.lang].setKeywords(evaluate('form.keywords_#application.languages["#variables.lang#"]#'))>
<cfelse> <!--- this language's value is empty : store default language's value --->
<cfset variables["cfc_" & variables.lang].setKeywords(variables.defaultKeywords)>
</cfif>
<!--- page's body --->
<cfset variables.valueToTest = evaluate('form.body_#application.languages["#variables.lang#"]#')>
<cfif variables.valueToTest NEQ "">
<cfset variables["cfc_" & variables.lang].setBody(evaluate('form.body_#application.languages["#variables.lang#"]#'))>
<cfelse> <!--- this language's value is empty : store default language's value --->
<cfset variables["cfc_" & variables.lang].setBody(variables.defaultBody)>
</cfif>
<!--- save data to the database --->
<cfset entitySave(evaluate('variables.cfc_#variables.lang#'))>
<cfset ormFlush()>
</cfif>
</cfloop>
Do you have an idea ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi both,
No I haven't any ; in my code.
Us I will try to rewrite & simplify
We'll see
No I haven't any ; in my code.
Us I will try to rewrite & simplify
We'll see
Yeah, I'd agree you should refactor. I'd rollback the "bad" changes and start with a last know "good" copy. Go from there.
I don't see any semi-colons ";" in that code. Are there any semi-colon's in the sections leading up to that line?
Complete shot in the dark, but sometimes I get that error when converting cfscript to cfml and forget to change the closing mark from ";" to ">", causing that error ie
<cfset b = 123; <=== invalid
<cfset b = 123> <=== valid