码迷,mamicode.com
首页 > 数据库 > 详细

Handbook之013:静态数组

时间:2015-10-25 06:13:19      阅读:259      评论:0      收藏:0      [点我收藏+]

标签:

静态数组赋值方法如下:

技术分享

 

代码如下:

unit Unit1;

interface

uses
  Winapi.Windows,
  Winapi.Messages,
  System.SysUtils,
  System.Variants,
  System.Classes,
  Vcl.Graphics,
  Vcl.Controls,
  Vcl.Forms,
  Vcl.Dialogs,
  Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
uses
  System.Diagnostics,
  System.Math;

type
  TDayTemperatures = array[1..24] of Integer;
//函数定义

procedure ShowStaticArrays();
var
  m_DayTemperatures: TDayTemperatures;
  I: Integer;
begin
  for I := Low(m_DayTemperatures) to High(m_DayTemperatures) do
  begin
    m_DayTemperatures[I] := I;
  end;

  for I := Low(m_DayTemperatures) to High(m_DayTemperatures) do
  begin
    Form1.Memo1.Lines.Add(m_DayTemperatures[ + I.ToString + ] :=  + m_DayTemperatures[I].ToString);
  end;

end;
//定义函数构型

type
  TIntProc = procedure(Num: Integer);

//计时
procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowStaticArrays();
end;

end.

Handbook之013:静态数组

标签:

原文地址:http://www.cnblogs.com/GodPan/p/4908129.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!