Changes between Version 5 and Version 6 of Methods
- Timestamp:
- 12/20/12 12:39:36 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Methods
v5 v6 8 8 Methods within a class are defined using the keyword '''def'''. 9 9 10 If not specifiedthe returnType of a method is void (i.e nothing returned) and the [wiki:AccessModifiers access modifiers] are '''public, virtual'''.10 If not explicitly specified, the returnType of a method is void (i.e nothing returned) and the [wiki:AccessModifiers access modifiers] are '''public, virtual'''. 11 11 12 12 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]] 13 13 If the name is prefixed with '''!__''' its access modifier defaults to ''private''. 14 14 15 Without that prefix on the name of the methodthe accessType is ''public, virtual'' and15 Without either of those prefixes on the name of the method, the accessType is ''public, virtual'' and 16 16 it must be accessed from within method code by prefixing the name with either '''this.''' or just '''.''' (dot) .[[BR]] 17 17 … … 38 38 '''vari''' indicates the parameter name is a placeholder for a variable length arglist. Within the method this may be unpacked/accessed as a list.[[BR]] 39 39 40 '''in''' (implicit) Args are only passed into the method. Any changes made to the argument inside the method are not visible outside the method (pass-by-value)[[BR]]40 '''in''' (implicit) args are only passed into the method. Any changes made to the argument inside the method are not visible outside the method (pass-by-value)[[BR]] 41 41 42 42 '''out''' the arg is returned from the method [[BR]]