Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control source depends on the _screen.ActiveForm
Message
De
11/07/2012 15:17:57
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01547969
Message ID:
01548218
Vues:
91
>>>That is...weird.
>>>If you need to update some properties in some form then pass it as parameter to the routine.
>>>You can't relay on the current form (maybe only if you have SDI).
>>
>>Current form may just not exist... or it may change on a whim, because of some event somewhere firing (timers, menu skipfor evaluation, anything).
>>
>>In this case, if reference to it was really necessary, I'd just store a reference to the form, and then get any references to controls from it... something like
>>
>>
loFrm=_screen.activeform
>>loCtl=getpem(loFrm, "controlname")
>>
>>The actual code would be at least five times longer, to include all the checks - that loFrm really is a form, that loCtl does exist, etc etc. Then these references would have to be stored into properties of the current form or some other object, and then I'd use these references as controlsources... which would still be bizarre and as flimsy as a house of credit cards.
>
>Switching from _screen.activeform to thisform seems to resolve the problem nicely for that particular block of code.

Of course, but that datum was unknown at the beginning, and I just ignored it temporarily for the sake of this mental exercise. It should be just a bit less stable than leaning on a unicycle.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform