Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error: not a valid ColdFusion variable name

Status
Not open for further replies.

Sinbad

Programmer
Nov 27, 2000
36
US
I recieve the following error message:

An exception occurred when executing a Com method.
The cause of this exception was that: coldfusion.runtime.NeoPageContext$InvalidVariableNameException: The string "e:/Inetpub/Intranet/WebContent/Compare/NewFile.htm" is not a valid ColdFusion variable name..


The related code is:

<cfset strOldFile = &quot;e:/Inetpub/Intranet/WebContent/Compare/OldFile.htm&quot;>
<cfset strNewFile = &quot;e:/Inetpub/Intranet/WebContent/Compare/NewFile.htm&quot;>
<cfset strCompFileOnly = FileComp & &quot;.doc&quot;>
<cfset strCompFile = &quot;e:/Inetpub/Intranet/WebContent/Compare/&quot; & strCompFileOnly>
<cfset strRTN = objCompare.CompareTwoFiles(strNewFile, strOldFile, strCompFile)>

This worked in the past but now that I have upgraded to ColdFusion MX, it does not. I do not understand why the error message refers to an invalided variable name when it is the value that contains the special characters. Does anyone know why I am getting this error?

Allan Jagos
Web Developer
Robinson & Cole LLP
 
Have you tried using the expandpath function then just appending a variable to the end for the last folder?
#expandpath(&quot;.&quot;)# will give you the current dir then just add the last folder you are tring to reach
#expandpath(&quot;.&quot;)##folder#
folder = &quot;/folder&quot;
 
Hi Alan,

Did you resolve this issue?


Thanks,

Frank Mamone
 
the only way I resolved it was by changing the values of the parameters. It didn't solve the problem per se but it was a work around for me. Allan Jagos
Web Developer
Robinson & Cole LLP
 
How exactly did you do that?

I'm depserate for a solution!

Thanks Alan.

Frank Mamone
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top