Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get the param from Classname::Method() 2

Status
Not open for further replies.

ron9999

Programmer
Feb 14, 2003
89
AT
I use a toolbar with a button prior
in button.click() I call
lnResult = _screen.ActiveForm.Prior()

the ActiveForm is a class of mybasfrm
the code in ActiveForm.Prior() is mybasfrm::prior()

in mybasfrm::prior() I return a parameter
how can i get the return-value in ActiveForm.Prior()

I try:
paramters lnPar1
mybasfrm::prior()

or
lnPar1=mybasfrm::prior()

*********
if I have no code in ActiveForm.Prior() I get the paramter
in toolbar.button.click() I get the lnResult.
lnResult = _screen.ActiveForm.Prior()
lnRusult has 0,1,2 or. 3
TIA
ron





 

Ron,

Basically, you've got to pass the result back down the calling chain. So, if Prior() in Mybasefrm is returning a result, this will have a RETURN which sends the result to Prior() in the active form.

The active form can use DODEFAULT() to pick up the result, and send it back to the button. The following code is probably all you need in the active form's Prior:

RETURN DODEFAULT()

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Mike,
your right, Mybasefrm ist returning the result to the click in button with no problem.
But I like to act according of the result in the active forms prior() method and send the result ahead to the button.

the toolbar has buttons like first,prior,next,last ....
and I use it with almost all forms.
in this activeform I check if a free related file is used by an other user. So I try to open it - check the errorhandler and if used I change the titelbar of the activeform.


toolbar.prior() && lnResult = _screen.ActiveForm.Prior()

|
|
V
activeform.prior() && mybasfrm::prior() (without it works) |
|
v
mybasfrm.prior() && change the rec
|
|
v
activeform.prior() && act according return value change titelbar send the result ahead to toolbar
|
|
v
toolbar.prior()


Ron
 
Make this the prior-method of your activeform:

Code:
LParameters tnPar1 && should ba as in mybasfrm::prior()
local lnRetval
lnRetval = DoDefault(tnPar1) && calls mybasfrm::prior()
* do something in dependance on lnRetval, eg:
if lnRetval = 1 
   this.caption = "whatever"
endif
Return lnRetval

Bye, Olaf.
 
thank you Olaf its working
Mike points me to right direction but I did'nt know how to use it.
thankx all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top