Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameters to generalised prompt/edit form
Message
 
 
To
13/02/2002 05:22:57
John Faithfull
Hunterian Museum, University of Glasgow,
Glasgow, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00618212
Message ID:
00619494
Views:
29
>Hello Larry,
>
>Some progress! It looks as though loparam object is being created OK. The problem is that it seems unavailable to the form when passed using
>
>do form editvar.scx with loparam
>
>What exactly do I need to put in the init event of the form to enable it to access loparam?
>
>Thanks for your patience...
>

John,
In the form's Init:
lparameter toparam
local llretval
llretval = .T.

if vartype(toparam) = 'O' then
   THISFORM.oParam = toParam
else
   * parameter object wasn't passed correctly so don't instantiate the form
   llretval = .F.
endif

With THISFORM
   if llretval then
      * param object passed corectly so set the values for form controls
      .text1.Value = .oParam.uVarOldValue
      .Caption = .oParam.cCaption
   endif
Endwith

return llretval
If the parameter object isn't passed then the Init will return .F.. The form will not instantiate.

Then in the Click method, you can access the form's oParam property. You can set the form up to have an oParam property from the Form Designer or you can add an AddProperty call in the Init method (it's up to you).

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform