delphi数据地址的传送改怎么定义?
delphi数据地址的传送改怎么定义?我看到了第20课的时候小甲鱼老师说把冒泡的过程封装起来,我是把原始接受的数据存入数组的,然后把数组地址传送到封包的函数过程中,但是数组地址的定义我还是朦朦胧胧。unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
edt1: TEdit;
btn1: TButton;
lbl1: TLabel;
procedure FormCreate(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure Maopao(var numb:array); //?这样子对吗?求指点求调教啊。procedure Maopao(var numb:array of integer);都不行。我试着希望能详细点,攒了几个鱼币奉献出来,还是学习交流为主哈。
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
var
n:integer=0;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
edt1.Width:=334;
edt1.Height:=30;
end;
procedure TForm1.btn1Click(Sender: TObject);
var
i:integer;
temp,str:string;
x,y,z:integer;
num: array of integer;
begin
str:=trim(edt1.Text);
i:=1;
while (i < length(str))do
begin
while((str<> #32) and (str<>#0))do
begin
temp:=temp+str;
i:=i+1;
end;
n:=n+1;
num:=strtoint(temp);
temp:='';
i:=i+1;
end;
for x:=1 to n do
begin
z:=n-x;
for y:=1 to z do
begin
if(num<num)then
begin
i:=num;
num:=num;
num:=i;
end;
end;
end;
edt1.text:='';
for i:=n downto 1 do
begin
edt1.text:=edt1.text+inttostr(num)+' ';
end;
end;
end.
不用加Var
procedure Maopao(num:array of integer);
应该是这样吧,我也记不清了~~ 好像不行啊。 同样求解啊!!!!
页:
[1]