• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Please help with cfscript error!

Community Beginner ,
Jan 12, 2007 Jan 12, 2007

Copy link to clipboard

Copied

When I run my app, I got this error:
sdfst_catcherror is recording this error: Context validation error for tag cfscript.; The start tag must have a matching end tag. An explicit end tag can be provided by adding </cfscript>. If the body of the tag is empty you can use the shortcut <cfscript .../>.
The CFML compiler was processing:

a cfscript tag beginning on line 45, column 4.
a cfscript tag beginning on line 45, column 4.

When I checked my codes, all the <cfscript></cfscript> have the pairs. There are only 2 pairs of <cfscript</cfscript> in this template.
See my code structure below:

<!--- the first <cfscript pair> --->
<cfscript>
function getTRS(var5)
{
some codes here...
return TRS;
}
</cfscript>

<cffunction name="FrmTxt" returntype="Struct">
<cfargument name="EmpCodes" required="true" type="array">
<cfargument name="EmpID" required="true" type="numeric">

<cfquery name="GetEmpInfo>
Select * from......
</cfquery>

<cfset varFrms = GetEmpInfo.EmpCodes>
<cfset A_Key = 1>
<cfset structFrmTxt = StructNew()>

<!--- The second pair --->
<cfscript>
Some codes here....
Need to output #TRS# returned by getTRS(var5) set above
</cfscript>

<cfreturn structFrmTxt>
</cffunction>

From other CF forum I learned that I can't put getTRS(var5) within the second <cfscript></cfscript> within <CFFUNCTION> pair
it says "You can't put UDF within UDF or method within method". When I did originally, I got this error:
"
Unable to complete CFML to Java translation, Error information unsupported statement: class coldfusion.compiler.ASTfunctionDefinition
"
I'm stuck and can't find any resources to solve this problem anymore, please help!....
TOPICS
Getting started

Views

614

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2007 Jan 12, 2007

Copy link to clipboard

Copied

LATEST
When I checked my codes, all the <cfscript></cfscript> have the pairs.

This error can often mean that you did not properly end a previous code
block or line. So the closing </cfscript> is being considered part of
that unclosed code. For me, it is often a missing semi-colon [;] on the
last line I wrote, missing a closing curly bracket [}] could do it as well.

Check your code, this is seldom more then missing a bit of syntax.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation