Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PROTECTED Keyword
Message
 
À
04/08/2005 10:33:12
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01038513
Message ID:
01038524
Vues:
15
PROTECTED means you can only access the member from within the class or
a subclass. Is there an Access method dealing with data?


>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
>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform