Wiki

Changes between Version 1 and Version 2 of Property

Show
Ignore:
Timestamp:
11/22/10 20:15:33 (14 years ago)
Author:
todd.a
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Property

    v1 v2  
    2121 
    2222{{{ 
     23#!cobra 
    2324var _nLife  = 47       # protected access 
    2425pro nLife from var     # property nLife uses backing var _nLife 
     
    3637Can implicitly create initialised backing variable and property in one line like 
    3738{{{ 
     39#!cobra 
    3840pro nLife = 47 
    3941}}} 
     
    99101== Examples == 
    100102{{{ 
     103#!cobra 
    101104class TimePeriod 
    102105    var seconds as float32 is private  
     
    122125 
    123126{{{ 
     127#!cobra 
    124128class Employee 
    125129    var numberOfEmployees as int = 0 
     
    156160Indexor example 
    157161{{{ 
     162#!cobra 
    158163class IdxColl 
    159164    var _coll = []