Your intinial post says you are upgrading from CF8 to CF10, but you say your code runs on CF9. How do you know? Have you tested it?
Did the error message in your second post come from the Code Analyzer for CF9? Have you run the analyzer for CF10?
The LOCAL scope was introduced with CF9, so I would expect the same kind of issues with your application when run under either CF9 or CF10. I don't think the functionality of the LOCAL scope changed between CF9 and CF10. The good news is that you shouldn't have to change all 2500 instances of "local"; you should only have to make changtes where it is being initially set as a variable or structure. Look for places where local is being defined as a variable or structure, such as:
- var local = {};
- var local = "";
- var local = StructNew();
- <cfset local = StructNew()>
- <cfset local = "">
Try commenting out those lines and see if code will then pass the analyzer without error. If it does, then go back and remove them.
Code that places additional keys/values into LOCAL or variables initially defined using a VAR statement should continue to work (such as the code you cited in your second post).
-Carl V.