Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generic Set Focus
Message
 
À
26/08/1998 13:13:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00130031
Message ID:
00130181
Vues:
25
>The problem is that there are probably a gazillion ways to do this but some of >those ways it's hard to explain without going too far into concepts that the >original poster may have problems with understanding. My personal favorite is >have a custom form property called "SelectOnEdit" that I have a default value >>(an object name) in each form but that can be modified by Got/LostFocus as >appropriate....
>
>Your way works well too, but you've got to applaud Ed's contribution as the >ultimate embodiment of KISS for this particular problem.

You have made my point John. Your comment about how the solution works says it all. Much about design as nothing to do with how things work. Rather, how things relate. I could come up with a bunch of half-baked ideas that would *work* the same way. A good design however, takes much more into account - not just what I need today - but what I need tomorrow. Also, a good design accounts for things that I need that can only be effectively accomplished when elements taken together - instead of separate - disjointed units. Error/Exception handling is one such item. Or, perhaps I need some pre/post processing.

As for simplicity, do you really think a simple class - like what I suggested - is that taxing???? To revisit, here is some code you suggested:

***
LOCAL i,nControlID
nControlID=0
FOR i = 1 TO THISFORM.Pgf1.Pages(THISFORM.Pgf1.ActivePage).ControlCount
IF PEMSTATUS(THISFORM.Pgf1.Pages(THISFORM.Pgf1.ActivePage).Controls(1),"SetFocus",5)
nControlID=i
EXIT
ENDIF
ENDFOR
IF nCotnrolID > 0
THISFORM.Pgf1.Pages(THISFORM.Pgf1.ActivePage).Controls(nControlID).SetFocus
ENDIF
***

Will it work.. I suppose so although I have not tested it. But, would I want to maintain it...heck no...at least, not outside the context of a class. Sorry, I don't see code like this has being all that good.

My point was about design, not how something worked. The fact that my post works the same way is just a side benefit < g >.

Oh.. as for the KISS principle, you know what the last word is right??? And that is what I think totally blowing off VFP's OO capabililities is.... stupid. But, that is just my opinion.

If you want to debate this... I am game....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform