Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PROTECTED Keyword
Message
De
04/08/2005 10:33:12
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
PROTECTED Keyword
Divers
Thread ID:
01038513
Message ID:
01038513
Vues:
74
See Help entry at bottom. What does this really do? Does that mean if I have Object.HireDate then it cannot be changed? Could that ever cause "attempting to lock" issues with data? We are having these in one of our processes, and this is the only thing I've found that seems like it could be related.

Here is the snippet of code from our process:
PROTECTED Archive_Tab AS Db_MorningStarDailyHistory  && the archive
PROTECTED MornStar_Tab AS Db_AllPossibleAccounts  && MornStar.dbf
PROTECTED Prices_Tab AS Db_Prices  && Price.dbf
What was the developer trying to accomplish here?

-------------------------------------------------------------------------

Protection and Hiding of Class Members

You can protect or hide properties and methods in a class definition with the PROTECTED and HIDDEN keywords of the DEFINE CLASS command. PROTECTED and HIDDEN properties can be declared together in a comma-separated list. Protected methods must be declared individually.
For example, if you create a class to hold employee information, and you don't want users to be able to change the hire date, you can protect the HireDate property. If users need to find out when an employee was hired, you can include a method to return the hire date.
DEFINE CLASS employee AS CUSTOM
PROTECTED HireDate
  First_Name = ""
  Last_Name = ""
  Address = ""
  HireDate = { - - }

PROCEDURE GetHireDate
  RETURN This.HireDate
ENDPROC
ENDDEFINE
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform