Difference between revisions of "Register"

From Free Pascal wiki
Jump to navigationJump to search
m (Fixed syntax highlighting)
 
Line 1: Line 1:
 
{{register}}
 
{{register}}
<br>
+
 
Back to the [[Reserved words | reserved words]]
+
 
<br><br>
+
Back to [[Reserved words | reserved words]]
The [[modifier]] <b> register </b> belongs to the calling conventions of internal and external subroutines. <br>
+
 
The modifier <b> register </b> is for compatibility with Delphi. <br>
+
 
The modifier has been supported since FPC 1.9.x. <br>
+
The [[modifier]] '''register''':
The modifier <b> register </b> is used to call the first three parameters in the register. <br>
+
 
<br>
+
* belongs to the calling conventions of internal and external subroutines;
Example: <br>
+
* is for compatibility with Delphi;
<Syntaxhighlight>
+
* has been supported since FPC 1.9.x;
 +
* is used to call the first three parameters in the register.
 +
 
 +
Example:
 +
 
 +
<syntaxhighlight lang=pascal>
 
function subTest: string; [register];
 
function subTest: string; [register];
 
begin
 
begin
Line 15: Line 20:
 
end;
 
end;
 
</Syntaxhighlight>
 
</Syntaxhighlight>
<br>
+
 
Example 2: <br>
+
Example 2:
<Syntaxhighlight>
+
 
 +
<syntaxhighlight lang=pascal>
 
function funcTest (strTestdaten: Pchar): LongWord; register; external 'Test.dll';
 
function funcTest (strTestdaten: Pchar): LongWord; register; external 'Test.dll';
 
</Syntaxhighlight>
 
</Syntaxhighlight>
<br>
 
<br>
 
--Translated from German by [[User:Mahdix18|Mahdix18]]
 

Latest revision as of 07:37, 25 February 2020

Deutsch (de) English (en) русский (ru)


Back to reserved words


The modifier register:

  • belongs to the calling conventions of internal and external subroutines;
  • is for compatibility with Delphi;
  • has been supported since FPC 1.9.x;
  • is used to call the first three parameters in the register.

Example:

function subTest: string; [register];
begin
   subTest: = 'abc';
end;

Example 2:

function funcTest (strTestdaten: Pchar): LongWord; register; external 'Test.dll';