BUG: FOR EACH Fails to Remove All ObjectsLast reviewed: November 21, 1997Article ID: Q176895 |
The information in this article applies to:
SYMPTOMSWhen you use FOR EACH in Visual FoxPro version 5.x as a looping mechanism to remove all objects in a container, only half of the objects in the container are removed.
RESOLUTIONWrap the FOR EACH command with the DO WHILE command. The following sample code is the workaround for the problem illustrated in the Steps to Reproduce Behavior section. Replace the code in the Click method with the following code:
DO WHILE Thisform.CommandGroup1.ButtonCount <> 0 FOR EACH oControl IN Thisform.CommandGroup1.Buttons Thisform.CommandGroup1.RemoveObject(oControl.Name) ENDFOR ENDDO STATUSMicrosoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
|
Additional query words: container remove
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |