Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 8 Empty Class
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00793345
Message ID:
00793685
Vues:
36
Yes, you have understand exactly what I have said.
And you have the solution.

conclusion: always click on the "see also" link in the help file :-)




>>BTW, if I bindevent to a property of many instances of the same classes
>>how can I know to which object you are binded?
>>
>>I suppose that I have to create an instance of the "event" class for each
>>and store a reference to the "prop only" object in it...
>
>If I understand correctly, you could check for the name of the object calling the bound method. Though not a generic way to do so, something like the following:
>PRIVATE o, x
>o = NEWOBJECT('Empty')
>ADDPROPERTY(o, 'FireInit')
>ADDPROPERTY(o, 'Name', 'O-Object')
>p = NEWOBJECT('Empty')
>ADDPROPERTY(p, 'FireInit')
>ADDPROPERTY(p, 'Name', 'P-Object')
>x = NEWOBJECT('EmptyMethods')
>BINDEVENT(o, 'FireInit', x, 'FireInit', 1)
>BINDEVENT(p, 'FireInit', x, 'FireInit', 1)
>CLEAR
>o.FireInit = [o1]
>p.FireInit = [p1]
>
>
>DEFINE CLASS EmptyMethods AS Custom
>
>	PROCEDURE FireInit
>*!*			IF TYPE('o.FireInit') = "N"
>*!*				o.FireInit = o.FireInit + 1
>*!*			ELSE
>*!*				o.FireInit = 1
>*!*			ENDIF
>		lnRetVal = AEVENTS(laEvents, 0)
>		WAIT WINDOW 'FireInit fired - Value =' ;
>                     + TRANSFORM(laEvents[1,1].FireInit) ;
>                     + '.  Called from ' + laEvents[1,1].Name
>	ENDPROC
>	PROCEDURE Release
>		RELEASE THIS
>	ENDPROC
>
>ENDDEFINE
>
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform