Accessing a Method

Methods are called and run by specifying the name of the object and name of the method to run as follows:


oObject.<methodproc>[()]
lcValue = oObject.<methodfunc>()

Note that the parenthesis are optional when calling a procedure method when there are no parameters being sent through. For example, you could call the SHOW method for an object called oForm with:


oForm.Show

or


oForm.Show()

It is good programming practice to always include the parenthesis, however, as it makes it clearer that you are calling a method.

Parameters sent through to a method are always included in the parenthesis (much like parameters are specified when calling a UDF in FoxPro 2.x).

The rules for accessing methods of object members is the same as those for members as shown above.