Wiki

Changes between Version 5 and Version 6 of Methods

Show
Ignore:
Timestamp:
12/20/12 12:39:36 (12 years ago)
Author:
hopscc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Methods

    v5 v6  
    88Methods within a class are defined using the keyword '''def'''. 
    99 
    10 If not specified the returnType of a method is void (i.e nothing returned)  and the [wiki:AccessModifiers access modifiers]  are '''public, virtual'''. 
     10If not explicitly specified, the returnType of a method is void (i.e nothing returned)  and the [wiki:AccessModifiers access modifiers]  are '''public, virtual'''. 
    1111 
    1212Like 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]] 
    1313If the name is prefixed with '''!__''' its access modifier defaults to ''private''. 
    1414 
    15 Without that prefix on the name of the method  the accessType is ''public, virtual'' and  
     15Without either of those prefixes on the name of the method,  the accessType is ''public, virtual'' and  
    1616it must be accessed from within method code by prefixing the name with either '''this.''' or just '''.''' (dot) .[[BR]] 
    1717 
     
    3838'''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]] 
    3939 
    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]] 
    4141 
    4242'''out''' the arg is returned from the method [[BR]]