Change the line to this, and it'll probably work
<cfset var local = structnew() />
Or this
<cfset var local.q = "" />
I've never seen the {} syntax before, but I assume it is shorthand for
creating a structure.
You could comment out line 3 completely, but then your 'local.q'
variable would be created as an instance variable on the component, not
a local variable to the function. This can cause odd issues sometimes.
dmkramerica wrote:
> Hey guys,
>
> I followed this seemingly great article, and I've found that in the Crud.cfc
> portion of the example (here specifically)...
>
> 1:<cfcomponent output="false">
> 2: <cffunction name="getData" access="remote" returntype="Query">
> 3: <cfset var local = {} />
> <cfquery name="local.q" datasource="mstest">
> select id, name, type
> from test
> </cfquery>
> <cfreturn local.q/>
> </cffunction>
>
> ...the 3rd line cfset var local = {} throws this error:
> "Invalid token '{' found on line 3"
>
> Is this a CF8 v CFMX702 thing? If so, what is the solution?
>
> If I comment out the line and remove the 'local' prefix to the query name
> 'q', the cfc runs fine, and a test.cfml that invokes the cfc works fine, but
> the swf never gets data. (I added crossdomain.xml with allow "*")
>
> I'm thinking two things
> 1) the query result needs a collection wrapper for Flex to work?
> And
> 2) that I might have a minor have endpoint and/or source description problem
> in the mxml for the remote object because I'm a tad unclear which "root" is
> being referred to web root, app root.
>
> Thoughts/help?
>
> Please and thank you.
>
> Dov
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location:
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>
>
--
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl.com/684b5h
http://www.twitter.com/reboog711 | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust