SystemSwap (Delphi)

From RAD Studio Code Examples
Revision as of 20:14, 3 November 2011 by L10nBot (talk | contribs) (normalized vcl links)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Description

Th following console application uses the Swap function to exchange the two low order bytes of an integer variable.

Code

program ProjectSwap;
{$APPTYPE CONSOLE}

uses
  SysUtils;

  var
  X: Integer;
begin
  X := $A0B1C2D3;
  Writeln(Format('$%.8x', [Swap(X)]));
end. { Put breakpoint here to see the console output }

Console output

$A0B1D3C2

Uses