Subject Re: & and class::
From Andy Taylor <andy.taylor.1959@outlook.com>
Date Fri, 05 Nov 2021 09:17:24 -0400
Newsgroups dbase.getting-started

Michel,

The class:: designation requires some context in which to work.
Your macro evaluates as the command:
   class::test()
So, you need to think about what "class" means to dBASE when you run your macro.

The OLH for the "Scope resolution operator" says that CLASS and SUPER may be used only inside a class definition.
CLASS refers to the class being defined and SUPER refers to the base class of the current class, if any.
So both Class and Super need the context of being run as part of the instantion code for a particular class.

If your test function exists in the form then the usual call would be form.test() if the form is the active form.
If the form is named "MyForm" then an alternative call might be MyForm::test() if you want to use the "::" operator.

You don't give us enough info in your post to say how & when you call the MYPROC method.
Please let us know a bit more about what you are trying to achieve.

Regards,
Andy

Incidentally you pass a variable reference called test to your procedure and also use a form.method called test.
I try to avoid having variable names the same name as a form method as it saves confusion (either for me or dBASE)....    

> Hello,
>
> trying to run the code below I receive this error message : "Not member of Class or Base class:  test"
>
> Procedure MYPROC(test)
> Cmd = "class::" + test + "()"
> &Cmd
> return
>
> the function test is really existing in the form.
>
> thanks for help
> Michel
>
>