
Pascal Delphi
文章平均质量分 74
iseekcode
Delphi票友
展开
-
Delphi 关键字详解
absolute//它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同.var Str: string[32]; StrLen: Byte absolute Str;//这个声明指定了变量StrLen起始地址与Str相同.//由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度.begin Str := abc转载 2009-10-21 11:41:00 · 712 阅读 · 0 评论 -
For those interested in storing components onto a stream
From: keeper@mindspring.com (Mark R. Johnson)Subject: Re: [Delphi] Solution: Using TStream/TWriDate: 19 May 1995 14:20:22 GMTFor those interested in storing components onto a stream, take a l转载 2010-01-09 12:09:00 · 752 阅读 · 0 评论 -
Delphi栈对象
//如需转载请注明出处//作者: 逍遥萧//来源: http://www.xy13.cn估计很多用了Delphi很多年的都不知道Delphi有支持栈对象.C++里对象即可以创建为堆对象,也可以创建为栈对象常用的对象都是从TObject继承,此种对象需要创建释放,不然会内存漏洞而栈对象不需要创建,也不需要释放,当对生命周期完成时会自动清理下面测试一下效果type PA = ^TA;转载 2010-01-08 15:42:00 · 1657 阅读 · 0 评论 -
Delphi字符串函数大全
Delphi字符串函数大全uses StrUtils; 【字符串函数大全】 首部 function AnsiResemblesText(const AText, AOther: string): Boolean; $[StrUtils.pas 功能 返回两个字符串是否相似 说明 ANSI(American National Standards Ins转载 2010-01-06 17:55:00 · 668 阅读 · 0 评论 -
Delphi 7事件的多处理机制
Delphi 7事件的多处理机制Allen Tao2007-08-19 首先解释一下这个题目。在我使用Delphi 7的过程中发现,一个对象的事件只能被一个过程处理。如果多次给这个对象的事件赋给处理事件的过程,最后真正处理事件的将是最后赋值的那个过程。例如,有类TMyClass中定义了一个事件OnSomeFired,在类TClientClass中该类被实例化,它的事件被处理。如下所转载 2010-03-06 21:15:00 · 1002 阅读 · 0 评论 -
Adding additional data members to forms
Adding additional data members to forms Suppose you want to add a new data member to a form. You want to initialize it in the constructor. What you will add is a constructor with your own name and th转载 2010-02-03 14:04:00 · 597 阅读 · 0 评论 -
The magic of method pointers
The magic of method pointers Date added/modified: 11 Nov 1999 You may not realize it but this is a concept at the core of Delphi technology and makes it truly amazing. You use it a转载 2010-02-03 14:03:00 · 667 阅读 · 0 评论 -
Delphi动态事件深入分析
Delphi动态事件深入分析2009-2-7 作者:不得闲核心提示:本实验证明了在类中方法的调用时候,所有的方法都隐含了一个Self参数,并且该参数作为对象方法的第一个参数传递...首先做一个空窗体,放入一Button。在implementation下面声明两个方法如下://外部方法,只声明一个参数,此时按照标准的对象内部事件方法TNotifyEvent声明,此声明中,Sender则对应为转载 2010-02-03 13:45:00 · 1305 阅读 · 0 评论 -
Delphi Question: Proper using of a Record Field/Property in a Class?
Delphi Question: Proper using of a Record Field/Property in a Class?Want to test your Delphi knowledge? Take a look at the following class declarations and code, then answer the poll question...转载 2010-02-02 23:27:00 · 981 阅读 · 0 评论 -
Delphi中的容器类
Delphi中的容器类作者 陈省 从Delphi 5开始VCL中增加了一个新的Contnrs单元,单元中定义了8个新的类,全部都是基于标准的TList 类。 TList 类TList 类实际上就是一个可以存储指针的容器类,提供了一系列的方法和属性来添加,删除,重排,定位,存取和排序容器中的类,它是基于数组的机制来实现的容器,比较类似于C++中的Vector和Java中的Arr转载 2009-12-02 09:29:00 · 4375 阅读 · 0 评论 -
Delphi字符串、PChar与字符数组之间的转换
Delphi字符串、PChar与字符数组之间的转换设有以下三个变量:vars:string;p:pchar;a:array[1..20] of char;那么三者之间的转换如下:1、字符串到PChar p:=PChar(s);2、PChar到字符串 s:=p;3、PChar到字符数组 StrCopy(@a,p);4、字符数组到PChar PChar(@a);5、字符串与字符转载 2009-12-02 10:43:00 · 12403 阅读 · 1 评论 -
vcl源码分析方法论
vcl源码分析方法论最近一段时间似乎流行源码分析:)我也来谈谈在过去一段时间里对VCL源码的分析方法方面的一点体会,本文将不探讨VCL类库的构架和设计模式方面的东本,只是以我们常见的控件属性/方法的实现过程作简单的说明,希望对初学者有所帮助VCL分析方法例:TButton.Caption属性的由来(本文仅以此献给DELPHI初学者) 用过一段时间DELPHI的朋友,都会对VCL源码感兴转载 2009-11-25 10:28:00 · 787 阅读 · 0 评论 -
浅谈Object Pascal的指针
大家都认为,C语言之所以强大,以及其自由性,很大部分体现在其灵活的指针运用上。因此,说指针是C语言的灵魂,一点都不为过。同时,这种说法也让很多人 产生误解,似乎只有C语言的指针才能算指针。Basic不支持指针,在此不论。其实,Pascal语言本身也是支持指针的。从最初的Pascal发展至今 的Object Pascal,可以说在指针运用上,丝毫不会逊色于C语言的指针。 以下内容分为八个部分,分转载 2009-10-28 22:43:00 · 585 阅读 · 0 评论 -
如何初始化数组和记录
delphi提供一个fillchar方法,使用它可以将数组初始化。1.建一项目,向其中添加一个bottom控件2.在该控件的onclick事件中添加代码如下:unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdC转载 2009-10-28 22:52:00 · 979 阅读 · 0 评论 -
Serialize / Stream (Read/Write) Configuration Settings
Serialize / Stream (Read/Write) Configuration SettingsStore Application Settings in a Delphi Class and Serialize it Binary to a FileCode submitted by Jens Borrisholt. Text by Zarko Gajic. Learn h转载 2010-01-09 14:09:00 · 677 阅读 · 0 评论