汉字与区位码(1) - 转换函数
摘要:先上转换函数: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2...
阅读全文
posted @
2008-11-19 10:14
万一
阅读(7700)
推荐(1) 编辑
合并两个 Wav 文件流的函数 - 回复 "刘文强" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/10/25/1069523.html#1351197 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;...
阅读全文
posted @
2008-10-25 22:07
万一
阅读(3054)
推荐(0) 编辑
合并两个 Wav 文件的函数
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button...
阅读全文
posted @
2008-10-25 21:54
万一
阅读(4100)
推荐(0) 编辑
建立快捷方式的函数: CreateShortcut - 非常实用、特别方便
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton...
阅读全文
posted @
2008-10-23 21:05
万一
阅读(8377)
推荐(0) 编辑
查看字符串在不同编码(ASCII、Unicode、UTF7、UTF8、Default、BigEndianUnicode)下的 Hex
摘要:本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Memo1: TMemo;...
阅读全文
posted @
2008-09-05 10:33
万一
阅读(11922)
推荐(0) 编辑
用 TBytesStream 类实现的读文件为十六进制字符的函数
摘要:本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; Memo2...
阅读全文
posted @
2008-09-04 17:28
万一
阅读(6693)
推荐(0) 编辑
复杂的结构化存取(三) : 存取函数
摘要:今天写了四个小函数, 拿来与大家共享: Dir2Doc: 把文件夹下的所有文件(不包括子文件夹)保存成一个复合文件; Doc2Dir: Dir2Doc 的反操作; ZipDir2Doc: 同 Dir2Doc, 只是同时执行了压缩; UnZipDoc2Dir: ZipDir2Doc 的反操作. 函数及测试代码(分别在 Delphi 2007 和 Delphi 2009 下测试通过): ...
阅读全文
posted @
2008-08-25 22:44
万一
阅读(6102)
推荐(0) 编辑
执行数学公式的函数 - 回复 "heyongan" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/08/16/1268786.html#1289015 本例在 Delphi 2007 和 Delphi 2009 中均调试通过, 运行效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Cl...
阅读全文
posted @
2008-08-16 19:24
万一
阅读(3398)
推荐(0) 编辑
对比两个文件是否相同的函数
摘要:function CompFile(const f1,f2: string): Boolean; var ms1,ms2: TMemoryStream; i,p: Integer; b1,b2: Byte; begin Result := False; if not (FileExists(f1) and FileExists(f2)) then Exit; ms1 :...
阅读全文
posted @
2008-08-12 14:56
万一
阅读(4621)
推荐(0) 编辑
根据窗口句柄获取所在程序路径 - 回复 "Haiwen" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/07/30/1255869.html#1272342 本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dia...
阅读全文
posted @
2008-07-30 17:35
万一
阅读(8748)
推荐(0) 编辑
获取多边形面积的函数 - 回复 "dacsd" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/07/09/1237697.html#1250073 我曾经傻呵呵地这样做过: http://www.cnblogs.com/del/archive/2008/07/08/1238238.html#1249117 代码文件: unit Unit1; interface uses Windows...
阅读全文
posted @
2008-07-10 01:01
万一
阅读(2853)
推荐(0) 编辑
给 Memo 排序的函数
摘要:本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; Butto...
阅读全文
posted @
2008-07-04 16:50
万一
阅读(3891)
推荐(0) 编辑
判断字符串中子串个数的函数
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end; v...
阅读全文
posted @
2008-06-09 18:16
万一
阅读(7398)
推荐(0) 编辑
获取变量类型的函数
摘要:Variants 单元下的 VarType 函数可以获取变量类型, 但它返回的只是一个数字; 需要再结合一下在 System 单元里定义的这些常量: varEmpty = $0000; varNull = $0001; varSmallint = $0002; varInteger = $0003; varSingle = $0004; varDouble = $0005...
阅读全文
posted @
2008-05-09 23:01
万一
阅读(5647)
推荐(0) 编辑
学习 TTreeView [13] - 在 TTreeView 中显示目录结构(的函数)
摘要:测试效果图: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls; type TForm1 = class(TForm) TreeView1...
阅读全文
posted @
2008-03-15 00:27
万一
阅读(6771)
推荐(0) 编辑
颜色转换函数: 从 Delphi 到 Html
摘要:{由 Delphi 的颜色常数转换到 Html 颜色} function HexColorToHtmlColor(c: Integer): string; var R,G,B: Byte; begin R := c and $FF; G := (c shr 8) and $FF; B := (c shr 16) and $FF; Result := #35 + Format(...
阅读全文
posted @
2008-02-19 15:08
万一
阅读(4789)
推荐(0) 编辑
理解 Delphi 的类(十) - 深入方法[28] - 递归函数实例: 搜索当前目录下的所有嵌套目录
摘要://上面一个例子不能说明递归函数的本质, 直接来个实用的函数吧, 刚好要用. unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) ...
阅读全文
posted @
2008-01-15 15:45
万一
阅读(5697)
推荐(0) 编辑
关于类的入门例子(9): 获取对象的 RTTI 属性与事件的函数
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, xmldom, XMLIntf, XMLBrokr, msxmldom, XMLDoc; type TForm1 = class(TFor...
阅读全文
posted @
2008-01-14 02:25
万一
阅读(6246)
推荐(0) 编辑
关于类的入门例子(8): 遍历窗体中所有控件的函数
摘要://显示窗体中所有控件的函数 function GetCtrls(Control: TWinControl; List: TStringList): Boolean; var i: Integer; obj: TWinControl; begin for i := 0 to Control.ControlCount-1 do begin obj := TWinContro...
阅读全文
posted @
2008-01-13 21:04
万一
阅读(6085)
推荐(0) 编辑
Delphi 中的 XMLDocument 类详解(14) - 遍历 XML 文件
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, xmldom, XMLIntf, msxmldom, XMLDoc, StdCtrls; type TForm1 = class(TForm) XML...
阅读全文
posted @
2008-01-03 22:16
万一
阅读(13383)
推荐(0) 编辑