BUG: FOR EACH Reference Fails To Release Automation Server (279777)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q279777 SYMPTOMS
If you use a FOR EACH loop to iterate through a collection of objects in an Automation Server, the server may not release correctly when you release the variables.
RESOLUTION
To resolve this problem, use the CLEAR ALL command to clear all memory, including any hidden references. This may not be an optimal solution, however, because you may be depending on variables that should remain in memory, such as an application object.
Another possible resolution is to find other ways to refer to the collection. For example, given the following code, you want to set a value for each cell in a range:
loRange = loWorkbook.ActiveSheet.Range("A1:D4,E5:H8")
*!* This loop will show the bug.
FOR EACH loCell in loRange
loCell.Value = "Fred"
ENDfor
*!* This single command will not.
loRange.Value = "Fred"
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/16/2002 |
---|
Keywords: | kbAutomation kbBug kbDSupport KB279777 |
---|
|