Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get the object value from parent form ?
Message
De
22/05/2014 00:58:07
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01600260
Message ID:
01600423
Vues:
64
>>Hmm, not 100% sure about that. Is there not still a dependency on the parameter object i.e. its (continued) existence, that it remains in scope/doesn't end up dangling etc. ?
>
>Those all 'made up problems' not real ones for a parameter object

Parameter objects are passed by reference. The temptation is for Child.Init() to simply store that reference somewhere (because that's easy), then use that to access the passed properties. If at some point the original parameter object disappears, but after that the child needs to access its properties via the stored reference, what happens then?

Yes, this can be avoided by the child storing the individual parameter object properties, at which point the object reference can be discarded. But that takes extra work and isn't obvious.

>>If you truly want to pass in parameters once and have them stay the same in the child, with no dependencies, the cleanest is probably to pass them as straight byval parameters.
>
>It's not. The parameters are passed in VFP by position so there's no way to know or verify that you are getting what you are expecting

Sanitizing input parameters is a different question, and needs to be done however parameters are passed.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform