Welcome to Third Wish Sign in | Help
in
Home Headlines Forums Downloads

Protected or Private

Last post 12-21-2006, 8:54 PM by Ge0ph. 1 replies.
Sort Posts: Previous Next
  •  12-21-2006, 8:40 PM 75

    Protected or Private

    What is the purpose of the Protected or Private keywords found at the  beginning of subroutine and functions definitions? Are they necessary? When I'm creating a subroutine of function, what should I be using?
  •  12-21-2006, 8:54 PM 76 in reply to 75

    Re: Protected or Private

    In its simplest form, a subroutine merely spells out the subroutine's name and input parameters, whereas a function must include its name, input parameter, and return value. However, in addition to these bare minimum pieces of information, a number of additional keywords can, optionally, be included.

    One such set of keywords is the access modifier keywords. These are the keywords that precede the keyword Sub of Function, and include these options: Private, Protected, Public, Friend, or Protected Friend. These access modifiers define how other classes and derived classes can use the subroutines and functions. When entering your own methods, you can always use Private. You can opt to type in this access modifier explicitly or simply omit it because the default is Private.


    Thanks,

    Ge0ph
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems