Old (keyword)

From The Oxygene Language Wiki

Jump to:navigation, search

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


Oxygene-48.png

Area: Oxygene Language
Compiler version: Oxygene 5

Language GlossaryKeywordsTypesFAQHow To

Navigation
Areas
More
Toolbox