delph i2007学习笔记(二)

龙门小亮

龙门小亮

2016-02-19 14:41

最近很多朋友喜欢上设计,但是大家却不知道如何去做,别担心有图老师给你解答,史上最全最棒的详细解说让你一看就懂。

  现在学的是delphi 的类,原D7的类我不就不记了,记下与D7不同的地方

  a.class abstract 纯虚类,不能实例化的类

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

type TAbstractClass = class abstract  procedure SomeProcedure;end;

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

   以前的做法是在 procedure 的后面与 abstract ,现在只移类的说明上,只是意思一样,就是直观点少打字 呵呵.

  b.class sealed 这个我目前不知是什么意思,可能是不能继承的类

type TAbstractClass = class sealed  procedure SomeProcedure;end;

  c.class const 类的常量,这个地方在D7内可以定类的方法一样能实现

type TClassWithConstant = class  public   const SomeConst = 'This is a class constant'; end;      procedure TForm1.FormCreate(Sender: TObject);begin ShowMessage(TClassWithConstant.SomeConst); //引用时,只写类名就可能引用,不必实例化end;d.class type 类的类型, 在类的层次下可以定record,class子类什么的,这个将数据的集中体现....type TClassWithClassType = class private  type   TRecordWithinAClass = record   SomeField: string;  end; public    class var   RecordWithinAClass: TRecordWithinAClass; end; ...procedure TForm1.FormCreate(Sender: TObject);begin TClassWithClassType.RecordWithinAClass.SomeField := 'This is a field of a class type declaration'; ShowMessage(TClassWithClassType.RecordWithinAClass.SomeField);end;type TOuterClass = class strict private  MyField: Integer; public  type   TInnerClass = class   public    MyInnerField: Integer;    procedure InnerProc;   end;   procedure OuterProc; end;  procedure TOuterClass.TInnerClass.InnerProc;begin ...end;

展开更多 50%)
分享

猜你喜欢

delph i2007学习笔记(二)

编程语言 网络编程
delph i2007学习笔记(二)

ASP+学习笔记(二)

ASP
ASP+学习笔记(二)

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

ADO.NET学习笔记(二)

电脑网络
ADO.NET学习笔记(二)

Jquery 学习笔记(二)

Web开发
Jquery 学习笔记(二)

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

AJax 学习笔记二(onreadystatechange的作用)

Web开发
AJax 学习笔记二(onreadystatechange的作用)

JQuery 学习笔记 选择器之二

Web开发
JQuery 学习笔记 选择器之二

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

如何使用命令行快速锁定Mac桌面

如何使用命令行快速锁定Mac桌面

JavaScript实例教程(十三)圣诞节的倒记时器

JavaScript实例教程(十三)圣诞节的倒记时器
下拉加载更多内容 ↓