Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SetAll Method
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01117604
Message ID:
01117722
Vues:
12
Jerry,

I opened UT again since I've finished with Shabbat preparations and have ~ 20 minutes.

In your method instead of passing name, pass the container object as an object. You would not need macro in your code and everything would be much easier to read and understand.

As for the code idea - I took this idea of SetAll + Assign more than 6 years ago from Trey Walpole. That was a very neat trick to avoid recursion. At that time I re-wrote our classes and gain quite a speed difference. Unfortunately, we didn't use the classes I implemented and continued to use the old version. I don't know the end of the story, since I had to leave that company...

>Naomi:
> Thanks! Your solution is very clever, and I like it. BTW, I live right near you- I'm in KGH.
> I also came up with a solution for my problem, although it doesn't use SetAll:
>
>***************************************************************************
>*Method "OrigValueSet"
>LPARAMETERS tcCCCN   &&cCurrentContainerName (a property on the form)
>
>LOCAL x, lcCCCn, v, y, z, a, d
>
>lcCCCN = tcCCCN + "ControlCount"
>FOR x = 1 TO &lcCCCN
>	v = tcCCCN + "Controls[" + allt(str(x)) + "]."
>	y = v + "Value"
>	z = v + "BaseClass"
>	d = v + "OrigValue"
>	DO CASE
>		CASE &z = 'Container' && Call this method recursively for subcontainers' controls
>			a = v + "Name"
>			This.OrigValueSet(ThisForm.cCurrentContainerName + &a + ".")
>		CASE TYPE('&y') = "U" && Controls without a .Value (such as labels and shapes)
>			LOOP
>		OTHERWISE && Set OrigValue = Value
>			&d = &y
>	ENDCASE
>ENDFOR
>***************************************************************************
>
>Have a Good Weekend,
>Jerry
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform