Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DO FORM vs. CREATEOBJECT
Message
De
19/05/1998 09:55:31
 
 
À
18/05/1998 14:07:25
Ryan Hirschey
Federal Reserve Bank of New York
New York City, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00100139
Message ID:
00100308
Vues:
55
>>>How would I convert "DO FORM xxx WITH yyy TO zzz" To "ofrm = CREATEOBJECT()"
>>>
>>>How do I return a value from an object when the object is created with "CREATEOBJECT()". Thanks.
>>
>>Just to add to what Ryan said. Be sure you check to make sure that the user didn't close the form using the Close button in the upper right hand corner. If they did, the variable will still evaluate to an object, but it will be null, and you won't have access to any of the properties.
>
>
>Good point. I was wondering if I was missing something. Here's a question, then. If the goal is to use a modal form and allow the user to choose some parameters and then pass them back to the calling routine upon closing, does CREATEOBJECT not handle this gracefully? In other words, would DO FORM be more appropriate, or can any return values from a form be read from a calling routine? If the return values can be read from the calling routine, how would this be done? Createobject seems great when you have one routine that starts and shuts down the object programmatically, but what would you do for the 'mixed' scenario you describe in which a routine starts an object, but something on the object itself closes it?

This is what I did to get CREATEOBJECT to return a value from a modal form

oprntprev = CREATEOBJECT('Print_Preview',tnDest)
oprntprev.show(1)
lnPrint = oprntprev.ReturnValr

Instead of Releasing the modal form, I issue a Thisform.Hide when the user exits. Control returns from the modal form, but I still have access to the objects properties(ReturnVal). There is probably a better way to do this, but this did work for me.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform