PROCEDURE <methodproc> (param1, param2 ....)/ENDPROC

This line of code defines a procedure method (a method that is a procedure as opposed to one that is a function). <Methodproc> refers to the name of the method. Parameters are accepted by enclosing the parameter variables in parens as shown above.

A few words of note are in order here.

There is no practical difference between creating a procedure method and a procedure we used to create in Microsoft FoxPro 2.x. The rules regarding memory variable scoping, coding constructs, and so forth, are virtually identical. A significant difference in scoping is the addition of the LOCAL scope, which scopes variables to the current procedure only.

Methods can be protected like member variables (i.e., they can only be called from other methods in the class) by adding the keyword PROTECTED before PROCEDURE (i.e. PROTECTED PROCEDURE <methodproc>).

Parameters can be accepted with the old PARAMETERS command. The syntax shown here is preferred from an OOP standpoint because it assigns a LOCAL scope to the variables. Note that there is a new LPARAMETERS command that not only accepts the parameters but also assigns them a LOCAL scope.

Procedure methods are closed with the ENDPROC command.