allright, I have quickly put something together and came up with the following
solution to display modified values from dropdowns, but I still have no good method to
display differences between strings.
I am thinking of performing the compareNoCase on the strings but that still will only
show whether there is a difference, not what is different, i.e. deleted or added... (I
might even use the MS SQL DIFFERENCE keyword instead and perform this within the db)
I am looking for some input, ideas and better ways... ;-))
Summary: I have an original resultset (unmodified) and a modified resultset (actually
wddx package), I'd like to display to the user what the differences are in detail (as
much detail as possible).
<cfset originalList = "1,2,3,4,5,55">
<cfset modifiedList = "2,5,7">
<cfscript>
function fnListToQuery( columnName, list )
{
var objQuery = queryNew(columnName);
for ( i = 1; i LTE listLen(list); i = i + 1 )
{
queryAddRow(objQuery, 1);
querySetCell(objQuery, "id", listGetAt(list, i), i);
}
return objQuery;
}
</cfscript>
<cfset objQuery = fnListToQuery( "id", originalList )>
<cfset objQuery2 = fnListToQuery( "id", modifiedList )>
<cfquery dbtype="query" name="qTest">
SELECT *
FROM objQuery
WHERE (id NOT IN(#modifiedList#))
</cfquery>
<cfquery dbtype="query" name="qTest2">
SELECT *
FROM objQuery2
WHERE (id NOT IN(#originalList#))
</cfquery>
<cfoutput>
<p>
<cfloop query="qTest">
Deleted: #qTest.id#<br>
</cfloop>
<cfloop query="qTest2">
Added: #qTest2.id#<br>
</cfloop>
</p>
I might even do the above within the RDMBS instead of CF.....
Taco Fleur
07 3535 5072
Blog: http://www.tacofleur.com/index/blog/
Methodology: http://www.tacofleur.com/index/methodology/
Tell me and I will forget
Show me and I will remember
Teach me and I will learn
-----Original Message-----
From: Mark Stanton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 11 February 2004 9:17 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Compare - display changes
> Cheers for the calendar, but I think it was Rob who was after
> a calendar ;-))
Sorry too early for my brain to be properly in gear yet :)
Cheers
Mark
------------------
Mark Stanton
Technical Director
Gruden Pty Ltd
Tel: 9956 6388
Mob: 0410 458 201
Fax: 9956 8433
http://www.gruden.com
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004