Left('a#num#',5) would just give you the letter a followed by a number not
the value of the field. You need to use the evaluate function and may need
to scope the variable to reference the query (unless this loop is inside a
loop over the database).
<CFIF Left(Evaluate("MYQUERY.a#num#"),5) is "Voice">
Also note that you are resetting the variable voice1 each time so it will
only have the final field with voice. Depending on what you want to do, you
might want to use ListAppend and make a list of all the fields with voice.
<cfset voice1 = ListAppend(voice1,'a#num#')>
> -----Original Message-----
> From: Marcus [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 24, 2000 6:07 PM
> To: [EMAIL PROTECTED]
> Subject: odd counting problem
>
>
> I've done this a hundred times, and yet I can't seem to remember
> how?
>
> I have a series of columns in a record that may, or may not have
> the word VOICE in them. I need to find all the ones that do. I wrote
> a little loop like so...
>
> <CFLOOP INDEX="num" FROM="0" TO="29">
> <cfif Left('a#num#',5) is 'VOICE'>
> <cfset voice1 = 'a#num#'>
> </cfif>
> </cfloop>
>
> But... this doesn't work. What am I doing wrong?
>
> Marcus
>
> PS... is there a way to lock a record in CF? ie, allow one user to
> have exclusive use of that record and no one else can touch it?
> Dr. Marcus Kiel
> Director of Development
> AdTel International
> ------------------------------------------------------------------
> ------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.