Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 14291

You have attempted to dereference a scalar variable of type class java.lang.String as a structure wi

$
0
0

You  have  attempted to dereference a scalar variable of type class  java.lang.String as a  structure with members

Hi

 

 

I receive the error in the title bar as a result of the following code but I can't see what I'm doing wrong:

 

<cfcomponent hint="sets background colour to help users see where they are during booking">

 

<cffunction name="cellcolour" returntype="struct">
<cfargument name="progressstage" type="string" required="true">
<cfset var stagecol="StructNew()">

 

<cfset oncolour="red">
<cfset offcolour="white">

<cfswitch expression="#progressstage#">
<cfcase value="progressstage1">
<cfset stagecol.colour1="#oncolour#">
<cfset stagecol.colour2="#offcolour#">
<cfset stagecol.colour3="#offcolour#">
<cfset stagecol.colour4="#offcolour#">
<cfset stagecol.colour5="#offcolour#">
</cfcase>

 

........... etc

 

Thew line where the error occurs is <cfset stagecol.colour1="#oncolour#">.

 

Thanks in advance for any advice

 

Dave


Viewing all articles
Browse latest Browse all 14291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>