Wiki

Changes between Version 9 and Version 10 of Classes

Show
Ignore:
Timestamp:
03/25/10 11:29:12 (14 years ago)
Author:
hopscc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Classes

    v9 v10  
    8282All Class and Instance variable names must start with a lowerCase Letter[[BR]] 
    8383 
    84 If the name is prefixed with an '''_''' its accessType defaults to ''protected'' and it is directly accessable from within the class method code.[[BR]] 
    85  
    86 Without that prefix on the name the variables  accessType is ''public, virtual'' (by default) and  
     84If the name is prefixed with an '''_''' (single underscore) its accessType defaults to ''protected'' and it is directly accessible from within the class method code.[[BR]] 
     85 
     86If the name is prefixed with an '''_ _''' (double underscore) its accessType defaults to ''private'' and it is directly accessible from within the class method code.[[BR]] 
     87 
     88Without that prefix on the name the variables  accessType is ''public'' (by default) and  
    8789it must be accessed from within method code by prefixing the name with either '''this.''' or just '''.''' .[[BR]] 
    8890 
    89 In either case the default [wiki:AccessModifier accessModifier] setting can be adjusted with an accessModifier clause.[[BR]] 
    90  
    91 Class (or static) variables are specified with the access Modifier  '''shared''' as in '''is shared''' 
     91In either case the default [wiki:AccessModifier access ] setting can be adjusted with an access modifier clause.[[BR]] 
     92 
     93Class (or static) variables are specified with the access modifier  '''shared''' as in '''is shared''' 
    9294e.g. 
    9395{{{ 
    94     var _x = 100 
     96    var _x = 100  # default protected 
    9597    def tryx( opnd as int) as int 
    9698        return _x + opnd 
    9799 
    98     var y is protected  # default public 
     100    var __x = 200 # default private 
     101    def tryPrivx( opnd as int) as int 
     102        return __x + opnd 
     103 
     104    var y is protected  # default public, explicit access modifier overrides setting to protected 
    99105    def tryy( opnd as int) as int 
    100106        return .y + opnd 
     
    133139If not specified the returnType is void ( i.e nothing returned)  and the [wiki:AccessModifiers access modifiers]  are '''public, virtual'''[[BR]] 
    134140 
    135 Like variables if the name is prefixed with an '''_''' its access modifier defaults to ''protected'' and it is directly accessable from within the class method code.[[BR]] 
    136  
    137 Without that prefix on the name the methods  the accessType is ''public, virtual'' and  
     141Like variables if the name is prefixed with an '''_''' its access modifier defaults to ''protected, virtual'' and it is directly accessible from within the class method code.[[BR]] 
     142If the name is prefixed with an '''_ _''' (double underscore) its access modifier defaults to ''private',virtual' and it is directly accessible from within the class method code.[[BR]] 
     143 
     144Without those prefixes on the name of the methods  the accessType is ''public, virtual'' and  
    138145it must be accessed from within method code by prefixing the name with either '''this.''' or just '''.''' .[[BR]] 
    139146