Followup:
Bryans description of a query as a struct of arrays lead me to try:
#qdata[form.toplevel][qdata.currentrow]#
which works fine.
I am still puzzled as to how passing the "pointer to an array" actually is
interpreted as the value from the above line but then even after years of cf
there are often puzzles found.
----- Original Message -----
From: "Don Vawter" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, December 14, 2001 5:40 PM
Subject: Re: Dynamic query columns weirdness
> But that seems inconsistent with what happens.
>
> The udf is simply
>
> function pad(st,stle){
> if(len(st) GE stle) return left(st,stle);
> st=st & repeatstring(" ",stle-len(st));
> return st;
> }
>
> If st were a pointer to an array wouldnt the udf choke?
> In fact the udf functions as designed, it takes the column value and pads
is
> appropriaately
>
>
> ----- Original Message -----
> From: "Bryan Love" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Friday, December 14, 2001 2:48 PM
> Subject: RE: Dynamic query columns weirdness
>
>
> > a query is a struct of arrays with each struct key representing a query
> > column, so to reference the value for a specific row you would say:
> >
> > qdata.column[number]
> >
> > You probably already know that struct keys can be accessed like so:
> > struct["keyname"]. Given that a query is a struct of arrays then
> > 'qdata[form.toplevel]' would simply return a pointer to an array - which
> can
> > be passed around (passed to your UDF), but never output.
> >
> > +-----------------------------------------------+
> > Bryan Love
> > Macromedia Certified Professional
> > Internet Application Developer
> > Database Analyst
> > Telecomunication Systems
> > [EMAIL PROTECTED]
> > +-----------------------------------------------+
> >
> > "...'If there must be trouble, let it be in my day, that my child may
have
> > peace'..."
> > - Thomas Paine, The American Crisis
> >
> >
> >
> > -----Original Message-----
> > From: Don Vawter [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, December 14, 2001 12:22 PM
> > To: CF-Talk
> > Subject: Dynamic query columns weirdness
> >
> >
> > The following works fine, qdata is a query, pad is a udf which returns
> > string padded with nonbreaking spaces. I put it on separate lines only
for
> > readability here.
> >
> > <option selected value="#vv#">
> >
> > #pad(qdata[form.toplevel],35)#
> >
> > #pad(qdata[form.midlevel],35)#
> >
> > #pad(qdata[form.lowlevel],35)#
> > </option>
> >
> > If I take out the pad function it fails, giving me a can't convert
> > qdata[form.toplevel] to a string.
> >
> > I wonder why it can pass the value to a udf but can't evaluate it to
> output.
> >
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists