请问大家声明函数时,返回数据为数组类型,如何定义;
function ArrayRandom():array [0..35] of integer;//这个有错
function ArrayRandom():array [0..35] of integer;//这个有错
解决方案 »
- Delphi 7中Dll工程调用 Filestream.create(filename,fmcreate) 报错
- 为什么我的IdTCPClient和IdTCPServer总是连接不上??
- CRC32验证数组问题
- 生成器生成exe时自动UPX压缩实现的问题???
- 弹出菜单项可用性问题
- 请问tbitmap各timage是线程安全的吗?
- 寻找:TVideoCap控件
- 问一个TDateTimepicker的问题
- 如何将鼠标限定在窗体范围之内!
- 请高手回答delphi比vb好在什么地方?(内详)
- 关于文件操作的问题!!!!!!!!!!!!!???????????????????????????????
- 请问怎么用HexToBin
TMyArr=array [0..35] of integer;function farrary:TMyArr;
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TMyArr=array [0..35] of integer;
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;function farrary:TMyArr;
implementation{$R *.DFM}
function farrary:TMyArr;
var
jsq:integer;
begin
for jsq:=0 to 35 do
begin
randomize;
result[0]:=random(100);
end;
end;procedure TForm1.Button1Click(Sender: TObject);
Var
rt:TMyArr;
jsq:integer;
begin
rt:=farrary;
for jsq:=0 to 35 do
listbox1.Items.Add(inttostr(rt[jsq]));
end;end.
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TMyArr=array [0..35] of integer;
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;function farrary:TMyArr;
implementation{$R *.DFM}
function farrary:TMyArr;
var
jsq:integer;
begin
randomize;
for jsq:=0 to 35 do
begin
result[jsq]:=random(100);
end;
end;procedure TForm1.Button1Click(Sender: TObject);
Var
rt:TMyArr;
jsq:integer;
begin
rt:=farrary;
listbox1.Clear;
for jsq:=0 to 35 do
listbox1.Items.Add(inttostr(rt[jsq]));
end;end.