???????? ?? ?????????????? ?? ???? ? ??????????????????, » ?????? ?????, ????????????, ????????? ??????????/p>
Copy Code | |
---|---|
DEFINE CLASS customer AS CUSTOM LastName = "" FirstName = "" Birthday = { - - } PROCEDURE Age IF !EMPTY(THIS.Birthday) RETURN YEAR(DATE()) - YEAR(THIS.Birthday) ELSE RETURN 0 ENDIF ENDPROC ENDDEFINE |
?????, ????? ??? ???? ?????????????? ???^??. u?????? ???, ?????????? u?» ?? ????????????? ?????? ???????? ????????? ???? ???? Visual FoxPro. ?? ???? » ????????????????? ????? ?????????? ? ? ?????? ???????? ???, ????
??? ???? ??? ???? ???? ?, ?Visua FoxPro ?? ???. ????? ??? ??» ?????????? ???? ?? ?????? ????? ??????? ? ?????????? ??????????? ???/p>
???, ????? ????? ??? ??????» ??? ?? ??? ???????????? ????? ?????????? ???? ??, ???????. ??????? ??????, » ???????? ???? ????. ±? ??» ???? - ??????????? ??? ???????????????? ???. ??????? ??? ??????????? ???, ???????, ????????/p>
Copy Code | |
---|---|
DEFINE CLASS NewUser AS CUSTOM PROTECTED LogonTime, AccessLevel UserId = "" PassWord = "" LogonTime = { - - : : } AccessLevel = 0 PROCEDURE Init DO FORM LOGON WITH ; && assuming you have created this form This.UserId, ; This.PassWord, ; This.AccessLevel This.LogonTime = DATETIME( ) ENDPROC * Create methods to return protected property values. PROCEDURE GetLogonTime RETURN This.LogonTime ENDPROC PROCEDURE GetAccessLevel RETURN This.AccessLevel ENDPROC ENDDEFINE |
?????? ?? ???? ????? ??, ????????code> NewUser:
Copy Code | |
---|---|
oUser = CREATEOBJECT('NewUser') oUser.Logon |
±?????????» ???? ???????????? » ?? ??? ?????code>oUser. ???:
Copy Code | |
---|---|
IF oUser.GetAccessLevel( ) >= 4 DO ADMIN.MPR ENDIF |