Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find a flaw in the logic
Message
De
12/01/2006 09:49:41
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01086027
Message ID:
01086049
Vues:
18
>>m.loObject.enabled = m.loObject.enabled and m.tlEnabled
>>
>>1) .T. + .T. = .T.
>>2) .T. + .F. = .F.
>>3) .F. + .T. = .F.
>>4) .F. + .F. = .F.
>>
>>I guess case 3 is not what you expect.
>
>You got it <g> Yes, I had to change this to create a new property on the fly. E.g. that's how I changed it a minute ago, which unfortunately will slow this method down a bit, but I don't see a better way:
>
>
>lparameters tlEnabled, toObject
>
>if vartype(m.toObject) <>"O"
>	toObject = this
>endif
>
>local lnI, lcBaseClass, loObject
>local array laIgnoreClasses[1]
>store space(100) to laIgnoreClasses[1]
>alines(laIgnoreClasses, this.cClassFilter,", ")
>
>for each m.loObject in m.toObject.objects
>	if not ascan(laIgnoreClasses,upper(m.loObject.baseclass)) > 0 ;
>			and not upper(m.loObject.parentclass) = [ABIZOBJ]
>		if pemstatus(m.loObject, "OBJECTS", 5) && Container object
>			this.SetEnabledStatus(m.tlEnabled, m.loObject) && Call the method recursively
>		else
>			if pemstatus(m.loObject, "Enabled", 5)
>				if not pemstatus(m.loObject, "lOriginalEnabledStatus", 5)
>					m.loObject.addproperty('lOriginalEnabledStatus', m.loObject.enabled)
>				endif
>				m.loObject.enabled = m.loObject.lOriginalEnabledStatus and m.tlEnabled
>			endif
>		endif
>	endif
>next
Well, I wouldn't worry about the speed too much. But you might use WITH/ENDWITH here. It is said that it will improve speed. And also you might write another routine that's called only once and adds the property to the objects. However, that scenario is only valid if you don't add objects dynamically.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform