Copy link to clipboard
Copied
I'm having a hard time figuring out the root of this error. Everything looks fine to me, and I've tried several different things...
Invalid CFML construct found on line 40 at column 22.
ColdFusion was looking at the following text: Invalid
The function is (line 40 is highlighted in blue)....
<cfscript>
function isValidAddress( address1, address2 )
{
if( Len(address1) )
{
return "Invalid Address empty string passed for address line 1.";
}
...
...
}
I've also tried created a string, and setting that string in the body of the if statement instead of returning.
....
var resultStr = "";
if( Len(address1) )
{
resultStr = "Invalid Address. Empty string passed for address line 1.";
}
...
return resultStr;
But I still receive the same error. Any help?? Thanks in advance!!
Any other code before that line?
This type of error is often caused by a earlier line not closing a set of quotes, hash markers, or parentheses.
Then when CF finally gets the quote in your "invalid.... it closes the previous quotes and then has no idea what to do with this "invalid" command it is trying to parse.
Copy link to clipboard
Copied
Any other code before that line?
This type of error is often caused by a earlier line not closing a set of quotes, hash markers, or parentheses.
Then when CF finally gets the quote in your "invalid.... it closes the previous quotes and then has no idea what to do with this "invalid" command it is trying to parse.
Copy link to clipboard
Copied
Yep. That's exactly what it was, an extra double-quote after a semicolon in the previous block of code. Thanks for the heads-up of what to look for when I see this error!
Copy link to clipboard
Copied
[Please ignore - crossed your earlier reactions in the post]
I get no problem with
<cfscript>
function isValidAddress( address1, address2 )
{
if( Len(address1) )
{
return "Invalid Address empty string passed for address line 1.";
}
}
</cfscript>
<cfoutput>#isValidAddress('test')#</cfoutput>