0
Complex object types cannot be converted to simple values.

/t5/coldfusion-discussions/complex-object-types-cannot-be-converted-to-simple-values/td-p/4587
Aug 30, 2006
Aug 30, 2006
Copy link to clipboard
Copied
I am new to MX7, I test two lines of code as below:
<cfset url="#cgi.script_name#">
<cfoutput>#url#</cfoutput>
Then the error message shows:
---------------------------
Complex object types cannot be converted to simple values.
The expression has requested a variable or an intermediate expression result as a simple value, however, the result cannot be converted to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are examples of complex values. .....
-----------------------
Please help.
<cfset url="#cgi.script_name#">
<cfoutput>#url#</cfoutput>
Then the error message shows:
---------------------------
Complex object types cannot be converted to simple values.
The expression has requested a variable or an intermediate expression result as a simple value, however, the result cannot be converted to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are examples of complex values. .....
-----------------------
Please help.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/complex-object-types-cannot-be-converted-to-simple-values/m-p/4588#M468
Aug 30, 2006
Aug 30, 2006
Copy link to clipboard
Copied
'URL' is a reserved variable in ColdFusion MX that contains
any GET
passed variables, ie the query string.
You just need to use something else for your variable.
<cfset myURL = cgi.script_name>
<cfoutput>#myURL#</cfoutput>
Also note that there is no need to use the #'s in the cfset.
passed variables, ie the query string.
You just need to use something else for your variable.
<cfset myURL = cgi.script_name>
<cfoutput>#myURL#</cfoutput>
Also note that there is no need to use the #'s in the cfset.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/complex-object-types-cannot-be-converted-to-simple-values/m-p/4589#M469
Aug 30, 2006
Aug 30, 2006
Copy link to clipboard
Copied
Thanks. I got it.
However, it worded in CF5.
However, it worded in CF5.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Mentor
,
LATEST
/t5/coldfusion-discussions/complex-object-types-cannot-be-converted-to-simple-values/m-p/4591#M471
Aug 30, 2006
Aug 30, 2006
Copy link to clipboard
Copied
Well, if you insist on naming your variable URL, then "scope"
it properly in the output.
This works, but I don't recommend it:
<cfset url=cgi.script_name>
<cfoutput>#variables.url#</cfoutput>
Phil
This works, but I don't recommend it:
<cfset url=cgi.script_name>
<cfoutput>#variables.url#</cfoutput>
Phil
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/complex-object-types-cannot-be-converted-to-simple-values/m-p/4590#M470
Aug 30, 2006
Aug 30, 2006
Copy link to clipboard
Copied
Thanks. I got it.
However, it worded in CF5.
Yes, in CF versions previous to MX you could override the 'URL' variable
structure with your own data.
Since MX, you can't do that anymore.
However, it worded in CF5.
Yes, in CF versions previous to MX you could override the 'URL' variable
structure with your own data.
Since MX, you can't do that anymore.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

