Object-oriented programming of Visual FoxPro (1)

zhaozj2021-02-16  100

Encapsulation

Class CLASS To define a class of CLASS must inherit to a class, before VFP8, it is generally inherited to Custom, but this class is still too cumbersome, there are too many useless methods and properties. In VFP8, a new class EMPYT is added, which is the LDM in the VFP. Define Class Screen As EmptyEnddefine

Properties VFP is a weak type of language, to define properties, must be assigned to an attribute. Define Class

Screen

AS

CustomcurrentMovie = "The Sound of Music" Availableseats = 150DATE = {

06/20/98

Enddefine

Method definition method can use function or procedure, which is Funciton to return a value, and Procedure cannot. Similar to Delphi.

Reference:

"Advanced Object Oriented Programming with Visual FoxPro 6.0"

转载请注明原文地址:https://www.9cbs.com/read-11157.html

New Post(0)