How can extend myMethod without parameters ?

Hi To all.
I have this method (example):

myMet(Extends p As TextField, byref theObj As TextField) ... theObj.Text = Str(iResult)
and I call it as: Me.ConvertWithAppDec(Me)
Ok, it is work. But do you remember, for example, PupUp.DeleteAllRows ?

How can I extend myMet without write inside parameters “byref theObj As TextField” ?
Like this:

myMet(Extends p As TextField) ... Me.Text = Str(iResult)
and I call it as: Me.ConvertWithAppDec
like PupUp.DeleteAllRows ?

Objects are passed automatically passed byRef. Your bottom example should work just fine. Am I missing something?

You don’t extend methods, you extend classes.

If you want a second method with a different set of parameters (or none at all) then just add it. It can even have the same name.

That you can have the same method with different parameters is called polymorphism in object-oriented programming.

my myMet is a Method inside the public Modules.
myNet convert the text to a particular decimal value, so when the user LostFocus from TextField, automatically the string is converted.
I repeat, Me.ConvertWithAppDec(Me) work fine, but Me.ConvertWithAppDec is appreciated…

@ Markus Winter:

  1. I tried to create this Class ==> Name: myTextField, Super: TextField with the Public Method: Me.ConvertWithAppDec.
  2. Obviously the TextField on Gui have Super: myTextField.
  3. Well, inside Gui TextField->LostFocus I write: Me.ConvertWithAppDec
    But do not work…

Where is the mistake?

[quote=171179:@Michele Giannelli]myMet(Extends p As TextField)

Me.Text = Str(iResult)[/quote]

p.Text = Str(iResult)

“p” is your object reference.