zoukankan      html  css  js  c++  java
  • Delphi方法

    unit Unit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;

    type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
      TKzx=class            //创建一个类
        Name:String;
        iYear:String;
        Procedure ShowName;       //声明一个普通方法
        class Procedure ShowStr; //声明一个类方法
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}
    Class Procedure TKzx.ShowStr ;   ///实现类方法
     begin
       ShowMessage('大家好');
     end;
    procedure TKzx.ShowName ;       //实现普通方法
     begin
       ShowMessage(Name);
     end;
    procedure ShowI(Const i;Var S:String);
     begin
       ShowMessage(s);
     end;
    procedure TForm1.Button1Click(Sender: TObject);
    Var
      Kzx:TKzx;
    begin
      Kzx:=TKzx.Create;
      Kzx.Name:='Kzx';
      Kzx.ShowName;       //引用普通方面
      Kzx.ShowStr;        //引用类主法
      TKzx.ShowStr; //直接调用类方法
    end;

    initialization
     finalization
    end.

  • 相关阅读:
    PHP下实现两种ajax跨域的解决方案之jsonp
    实际应用中git(合并本地与服务器项目)
    centos7 编译安装nginx
    windows vagrant共享目录设置问题
    shell 需要注意的点
    插入排序(直接插入排序)
    选择排序
    快速排序
    冒泡排序
    centos7.5安装redis-5.0.4
  • 原文地址:https://www.cnblogs.com/wuxi15/p/3397041.html
Copyright © 2011-2022 走看看