Changes between Version 9 and Version 10 of Classes
- Timestamp:
- 03/25/10 11:29:12 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Classes
v9 v10 82 82 All Class and Instance variable names must start with a lowerCase Letter[[BR]] 83 83 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 84 If 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 86 If 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 88 Without that prefix on the name the variables accessType is ''public'' (by default) and 87 89 it must be accessed from within method code by prefixing the name with either '''this.''' or just '''.''' .[[BR]] 88 90 89 In either case the default [wiki:AccessModifier access Modifier] 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'''91 In either case the default [wiki:AccessModifier access ] setting can be adjusted with an access modifier clause.[[BR]] 92 93 Class (or static) variables are specified with the access modifier '''shared''' as in '''is shared''' 92 94 e.g. 93 95 {{{ 94 var _x = 100 96 var _x = 100 # default protected 95 97 def tryx( opnd as int) as int 96 98 return _x + opnd 97 99 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 99 105 def tryy( opnd as int) as int 100 106 return .y + opnd … … 133 139 If not specified the returnType is void ( i.e nothing returned) and the [wiki:AccessModifiers access modifiers] are '''public, virtual'''[[BR]] 134 140 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 141 Like 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]] 142 If 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 144 Without those prefixes on the name of the methods the accessType is ''public, virtual'' and 138 145 it must be accessed from within method code by prefixing the name with either '''this.''' or just '''.''' .[[BR]] 139 146