Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array question
Message
From
09/09/1998 14:37:26
 
 
To
09/09/1998 14:33:27
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00134705
Message ID:
00134708
Views:
9
>I have created an array to access several command buttons in the forms init procedure.
>
>Public Array MyArray[2]
>MyArray[1] = Thisform.cmdOne
>MyArray[2] = Thisform.cmdTwo
>
>In another command buttons click event, I have the following code.
>
>For i = 1 To 2
> MyArray[i].Caption = "Test " + Alltrim(Str(i))
>EndFor
>
>When I run the form the command button works properly and changes the captions on the other buttons. But when I attempt to exit the form I get an error message...
>
>File cannot be closed because outstanding references exist.
>Can anybody help me out?
>Thanks in advance for any help offered.
>
>John Symons

All such references should be set to .NULL. in form destroy event. In your case it means MyArray=.NULL.
Also, you could consider using form's property-array, it's better way.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform