zoukankan      html  css  js  c++  java
  • delphi Tlist 不太懂

     1 type
     2   TForm1 = class(TForm)
     3     Button1: TButton;
     4     Label1: TLabel;
     5     Button2: TButton;
     6     procedure Button1Click(Sender: TObject);
     7     procedure Button2Click(Sender: TObject);
     8   private
     9     { Private declarations }
    10   public
    11     { Public declarations }
    12   end;
    13 
    14   WList = record
    15     Cone   :String;
    16     Ctwo   :String;
    17     end;
    18   wMyList = ^WList;
    19 
    20 var
    21   Form1: TForm1;
    22 
    23   MyList  : TList;
    24 
    25 implementation
    26 
    27 {$R *.dfm}
    28 
    29 procedure TForm1.Button1Click(Sender: TObject);
    30 var
    31    Rows :wMyList;
    32 
    33 begin
    34    MyList := TList.Create;
    35    new(Rows);
    36    Rows.Cone   := '神奇';
    37    Rows.Ctwo := '魔力';
    38    MyList.Add(Pointer(Rows));
    39 end;
    40 
    41 procedure TForm1.Button2Click(Sender: TObject);
    42 var
    43    Rows :wMyList;
    44 begin
    45    if MyList = nil then
    46    begin
    47      exit;
    48    end
    49    else
    50    begin
    51      Rows:= wMyList(MyList.Items[0]);
    52      Label1.Caption := Rows.Cone + Rows.Ctwo;
    53    end;
    54 end;

    delphi 用起来有点麻烦啊。。 

  • 相关阅读:
    jQuery$命名冲突问题解决方法
    微信小程序开发工具 ubuntu linux版本
    阿里云Https通配符证书购买
    vs2017安装
    规范与标准
    Jvm远程监控
    Bash笔记
    Html5前端笔记
    Php7 开发笔记
    webpack笔记
  • 原文地址:https://www.cnblogs.com/ccqin/p/2589707.html
Copyright © 2011-2022 走看看