Special variables: Difference between revisions
Content deleted Content added
m →{{header|Wren}}: Changed to Wren S/H |
PascalABC.NET |
||
Line 1,609:
end.</syntaxhighlight>
Note that some run-time libraries of compilers usually ship a variety of predefined variables, but these are not part of the programming language itself.
=={{header|PascalABC.NET}}==
Result is a special variable for the result of a function
<syntaxhighlight lang="delphi">
function Add(a,b: integer): integer;
begin
Result := a + b
end;
</syntaxhighlight>
Self is a special variable defined in every non-static method of a class. It is a reference to the current object
<syntaxhighlight lang="delphi">
type A = class
n: integer;
constructor (n: integer);
begin
Self.n := n
end;
end;
</syntaxhighlight>
value is a special variable defined in setter of a property. This is a value which is assigned in a right part of an assignment
<syntaxhighlight lang="delphi">
type A = class
n: integer;
property pn: integer write n := value;
end;
</syntaxhighlight>
=={{header|PARI/GP}}==
|