
23.04.2013, 09:24
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
arr: array [0..1, 0..3] of Word;
x, y: Byte;
hFile: THandle;
Dummy: DWORD;
begin
Memo1.Clear;
for x:=0 to 1 do
for y:=0 to 3 do
begin
arr[x, y]:=x shl 8 or y;
Memo1.Lines.Add(Format('%.4x', [arr[x, y]]));
end;
hFile:=CreateFile('Project1.txt', GENERIC_WRITE, 0, nil, CREATE_ALWAYS, 0, 0);
WriteFile(hFile, PByte(@arr[0, 0])^, SizeOf(arr), Dummy, nil);
CloseHandle(hFile);
end;
end.
|