Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return Value from VCX
Message
De
02/04/2001 13:52:11
Larry Rix
Larry Rix & Associates, Inc.
Westminster, Colorado, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Return Value from VCX
Divers
Thread ID:
00491003
Message ID:
00491003
Vues:
58
I am looking for suggestions on returning a value from a VCX based form. As you already know, a VCX form instantiated with loMyObject = createobject("frm_MyForm", lnParm1, ...) cannot be told to capture a return value (as with SCX based DO FORM WITH ... TO ...).

Here are some notes regarding the issue as I currently understand it. Your feedback is appreciated.

1. One solution I see is that the Client module (the class issuing the createobject instruction) passes the Supplier form class object an object reference with a Client command method to run upon completion. Thus:

Client Method Code says:

local loMyObject
loMyObject = createobject("frm_MyForm",[THIS|THISFORM],"cmReturnMethod")

The Supplier Form Init says:

lparameters loClientObject, lcReturnMethod
THIS.cmSetClientObject(loClientObject)
THIS.cmSetReturnMethod(lcReturnMethod)

...

Later, the Supplier executes the following code as it is exiting:

local loClientObject, lcReturnMethod, luReturnValue
loClientObject = THIS.qoClientObject()
lcReturnMethod = THIS.qcReturnMethod
lcReturnValue = qcReturnValue()

evaluate("loClientObject." + lcReturnMethod + "(" + lcReturnValue + ")")

return

There are advantages and disadvantages to this method:

Advantages:

1. It provides that the Client form retains a level of genericity in that there is a generic Client Object reference with a generic return value method.

Disadvantages:

1. The return method MUST exist in the calling Client class object.

2. The return method of the Client is restricted to the character or string data type of the return value without complex data type management coding in either the Client or in the Supplier.

I know there is probably a flaw in this thinking somewhere, but I cannot see it.

Thanks in advance for you assistance.

Larry
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform