📄 copymemoryu.pas
字号:
unit CopyMemoryu;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Grids;
type
TForm1 = class(TForm)
Button1: TButton;
StringGrid1: TStringGrid;
StringGrid2: TStringGrid;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Info1, Info2: array[0..99] of byte; // the copy from and copy to buffers
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
var
iLoop: Integer;
begin
{fill the source buffer with information, and display this in the
string grid}
for iLoop := 1 to 100 do
begin
Info1[iLoop-1] := iLoop;
StringGrid1.Cells[iLoop-1, 0] := IntToStr(Info1[iLoop-1]);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
iLoop: integer;
begin
{copy the source buffer into the destination buffer}
CopyMemory(@Info2, @Info1, SizeOf(Info1));
{display the result in the second string grid}
for iLoop := 1 to 100 do
StringGrid2.Cells[iLoop-1, 0] := IntToStr(Info2[iLoop-1]);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -