I'd be tempted to ditch the array and use a query - then do a query of
queries to do the search rather than a loop.

As for stripping the [ and ] , I'd just use REReplace to get rid of
them before the search.

I'm not quite sure what the evaluate() is for.

On 7/5/07, Les Mizzell <[EMAIL PROTECTED]> wrote:
> I'm working on creating an "audit trail" for a database (and have
> discussed methods here earlier. I've had triggers set up that records
> all changes, dates, the field name in question and before/after values.
>
> I've got it working GREAT except that the client needs to see the form
> label values, not the actual field name in the database:
>
> "Date Database Taken Offline" instead of "I_M1_dtOFFLINE"
>
> We tried doing this by accessing the "comments" field in the SQL Server
> database and adding the labels there, but to no avail. All I can figure
> to do it set an array for each table connecting the field names and
> database table names:
>
> <cfset array_genINFO=ArrayNew(2)>
>     <cfset array_genINFO[1][1]="IA_sysname">
>     <cfset array_genINFO[1][2]="1. Logical System Name">
>     <cfset array_genINFO[2][1]="IB_funct_area">
>     <cfset array_genINFO[2][2]="2. System Functional Area">
>
> ....... and so on
>
> OK, so I now need to return the results from my audit table and match up
> the values. - with are stored as "[fieldname]" (with the brackets stored
> as part of the value - and then display the label instead of the fieldname
>
> Something like:
>
> <cfloop start="1" end="43" index="i">
>       <cfif #getAUDIT.FieldName# EQ #evaluate(array_genINFO[#i#][1])#>
>          Changed Field: #evaluate(array_genINFO[#i#][2])#
>       </cfif>
> </cfloop>
>
> The darned brackets stored in "#getAUDIT1.FieldName#" are throwing me
> off though - so the above isn't quite correct. You end up with:
>
> <cfif "[somefieldname]" eq "somefieldname">
>
> How do I strip those brackets, keep the loop working correctly and find
> the appropriate value? It's simple I'm sure, but I've been awake too
> long and can't quite grasp it at this moment.
>
> Little help please?
>
> Thanks
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:282938
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to