Old (keyword)
From The Oxygene Language Wiki
This is a Language topic
Feel free to add your notes to this topic below.
The old keyword is provided for use in ensure sections only. It allows you to test the effect on a field during a method, e.g.:
method MyObject.Add(aItem: ListItem); begin InternalList.Add(aItem); ensure Count = old Count +1; end;
"old" is only supported for integers and value types for local variables & parameters and the compiler saves the values of the field(s) as they were at the start of the method.
See Also
Area: Oxygene Language
Compiler version: Oxygene 5
Language Glossary — Keywords — Types — FAQ — How To