<cfquery name="data" datasource="myDSN">
SELECT TOP 2 field1 as myField
FROM myTable
</cfquery>
<cfset field = "myField">
<h4>ArraySwap</h4>
<cfdump var="#data#">
<cfset c = arraySwap(data[field], 1, 2)>
arrayswap: #c#<br>
<cfif c eq "Yes">
        <cfdump var="#data#">
</cfif>
</cfoutput>

Just as a test!  Quite exciting really...

Paul

> -----Original Message-----
> From: Paul Johnston [mailto:[EMAIL PROTECTED] 
> Sent: 13 June 2003 14:57
> To: [EMAIL PROTECTED]
> Subject: RE: [ cf-dev ] Extracting values from a returned query
> 
> 
> Oops... You CAN do an arrayswap however!
> 
> Paul
> 
> > -----Original Message-----
> > From: Rich Wild [mailto:[EMAIL PROTECTED]
> > Sent: 13 June 2003 14:38
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: [ cf-dev ] Extracting values from a returned query
> > 
> > 
> > but unsurprisingly, arrayappend(foo["col1"], "biscuits") does
> > work, yielding the following error:
> > 
> > The method cannot be applied to a query column.
> > Query columns do not support methods that would alter the 
> > structure of a query column; you must use an analogous method 
> > on the query.  
> > 
> > > -----Original Message-----
> > > From: Rich Wild [mailto:[EMAIL PROTECTED]
> > > Sent: 13 June 2003 14:35
> > > To: '[EMAIL PROTECTED]'
> > > Subject: RE: [ cf-dev ] Extracting values from a returned query
> > > 
> > > 
> > > well, the following works:
> > > 
> > > <cfoutput>#arraylen(foo["col1"])#</cfoutput>
> > > 
> > > where foo is a query.
> > > 
> > > so does
> > > 
> > > arraytolist(foo["col1"])
> > > 
> > > > -----Original Message-----
> > > > From: Stephen Moretti [mailto:[EMAIL PROTECTED]
> > > > Sent: 13 June 2003 14:39
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Re: [ cf-dev ] Extracting values from a returned query
> > > > 
> > > > 
> > > > >
> > > > > <cfif IsArray(data[listfirst(data.columnlist)])>
> > > > > <cfoutput>
> > > > > data[#listfirst(data.columnlist)#] is array<br> </cfoutput> 
> > > > > </cfif>
> > > > >
> > > > > In CFMX tells you that "data" is a query and NOT a
> > > > structure and that
> > > > > data[columname] is an array.
> > > > >
> > > > 
> > > > So go on then... Next step... try the array functions on
> > > > data[columnname]... ;o)
> > > > 
> > > > I'm not saying it won't work, cos to be honest I don't know the 
> > > > answer, I just want you to do the work for me... ;oD
> > > > 
> > > > 
> > > > 
> > > > --
> > > > ** Archive:
> > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > > 
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED] For
> > > human help, e-mail: [EMAIL PROTECTED]
> > > 
> > 
> > 
> > --
> > ** Archive: 
> http://www.mail-archive.com/dev%> 40lists.cfdeveloper.co.uk/
> > 
> 
> > To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED] For human help, e-mail: 
> > [EMAIL PROTECTED]
> > 
> > 
> > --
> > ** Archive: 
> http://www.mail-archive.com/dev%> 40lists.cfdeveloper.co.uk/
> > 
> 
> > To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED] For human help, e-mail: 
> > [EMAIL PROTECTED]
> > 
> 
> 
> 
> -- 
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
> 



-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to