Out (keyword)

From RemObjects Software

Jump to: navigation, search

This is a Oxygene Keyword topic
Feel free to add your notes to this topic below.



The out keyword causes arguments to be passed into method by reference. Similar to var, but it does not need to be initialized by the caller.

Example

method Method1(out i: Integer);
begin
  i := 44;
end;

method Method2;
begin
  var value: Integer;
  Method1(out value);
  // value is now 44
end;

The .NET runtime does not really support out params though, so when you define them in Oxygene (or C#) they are really just var parameters with that attribute. The compiler doesn't really treat the [Out] attribute as special, but just uses it when it finds the out keyword.


See Also


Product: RemObjects Oxygene (formerly known as Chrome)
Current version: 3.0 Previous Versions: 'Joyride' (2.0), 'Floorshow' (1.5), 'Adrenochrome' (1.0)

GlossaryKeywordsLanguage FeaturesPlatform FeaturesSamplesArticlesHow ToIssues

Personal tools