Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Neat feature about Collection Class
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00791053
Message ID:
00803087
Views:
22
Mark & Barbara

I also have a Windows Manager Class.

In the past I always used an array to store the references to any
open windows. I updated it to a collection as soon as I got VFP8.

The class has an OpenWindow function that takes the name of the
form class to instantiate. It creates the instance, incrementing
the Name property (MyForm1, MyForm2...), stores it to the collection
and returns an object reference to the newly created form.

The in the CloseForm method on the form, I call
oApp.oWindows.CloseForm(ThisForm.Name)
Which does:
LPARAMETERS cFormName
FOR EACH oForm IN This.oWindows && oWindows is a collection

  IF oForm.Name == cFormName
    RELEASE oForm
  ENDIF

NEXT
I have subclassed it for use with toolbars, and I've added various
PEMS along the way, and I've used it since with no problems.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Reply
Map
View

Click here to load this message in the networking platform