Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can an object know of it's existence?
Message
 
À
02/12/2003 14:22:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00855003
Message ID:
00855168
Vues:
23
Does SYS(2015) have a more discrete resolution than 1/1000 seconds? If not, is there not a possibility that the same handle could be assigned to more than one object or property?


>Counterexamples:
>
>
= createobject("custom")
>with createobject("custom")
>   * ...
>endwith
>return createobject("custom")
>
>What are the names of the created objects?
>
>
local o1, o2, a[1]
>o1 = createobject("custom")
>o2 = m.o1
>a[1] = m.o1
>
>What is 'the' name of the created object?
>
>As I said, if you need a global name then you need a global anchor of sorts. Fernando's suggestion is the easy to implement and should be fairly robust, especially if you make good use of SYS(2015) where appropriate. If you want to keep the number of global names used to a minimum then a CUSTOM object could serve as a collection (.AddObject your objects to it with a SYS(2015)-enhanced name so that you can access them by name or via the .Controls collection). This registry object would consume only one global name but it could provide any number of globally reachable names for your objects. If you .AddObject the registry object - or your objects themselves - to the global _SCREEN object then they will survive a CLOS ALL and a RELE ALL EXTE. *g*
Imagination is more important than knowledge
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform