如何使用THashedStringList
1.添加
uses system.IniFiles
2.实例代码:
unit Unit1; interface uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs,System.IniFiles, Vcl.StdCtrls;
type
Ps=^string;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
gg:THashedStringList;
public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);
var
str:string;
PP:Ps;
I:Integer;
begin
gg:=THashedStringList.Create;
gg.Sort;
for I := to do
begin
str:=IntToStr(i)+'MM';
pp:=Addr(str);
gg.AddObject(IntToStr(i),TObject(Integer(pp)));
Self.Button1.Caption :=IntToStr(gg.IndexOf(IntToStr(i)));
end; end; end.
本例程在delphi XE6下通过。
如何使用THashedStringList的更多相关文章
- Delphi容器类之---Tlist,TStringlist,THashedStringlist的效率比较
转载自:http://www.ylzx8.cn/windows/delphi/73200.html 本人在做一个测试,服务器是IOCP的,我假定最大链接数是50000个. 测试背景:如果每个链接之间的 ...
- [转]:Delphi 中的哈希表(1): THashedStringList
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...
- Delphi 中的哈希表: THashedStringList
转自万一博客 Delphi 中的哈希表: THashedStringList unit Unit1; interface uses Windows, Messages, SysUtils, Var ...
- Delphi THashedStringList用法
Delphi中的THashedStringList对象 Delphi在在IniFiles 单元中定义了THashedStringList类: THashedStringList = class(TSt ...
- zw.delphi不同版本程序运行速度测试
{ zw.delphi不同版本程序运行速度测试 delphi无论是开发,编译,还是运行,速度方面向来不差,笔者很少进行这种微粒度的优化,调试. 最近,因为项目需要,发现:同一个函数模块,差不多同样的代 ...
- 关于内存数据与 JSON
闲话: 正在用 WebBroker 写一个小网站,感受颇多: 1.如果是写一个小东西,应该先考虑下 WebBroker,因为它是分分钟即可上手的. 2.如果要写一个大东西,或许也应该考虑下 WebBr ...
- Delphi 中的哈希表(二)—— TStringHash
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...
- Delphi的哈希表(一)
哈希表是通过哈希值来访问的,通过一定的内存浪费获取检索速度,在检索项时是不需要逐一检索.在编程中有一定的好处. unit Unit1; interface uses Windows, Messages ...
- delphi 各版本的特性
delphi 各新版本特性收集 Delphi XE6新增了一些特性并增强了原有的功能,主要有以下几个方面: IDE(整合开发环境) Internet XML(扩展标记语言) Compiler( ...
随机推荐
- C#模拟键盘事件
public partial class Form1 : Form { public Form1() { InitializeComponent(); } [DllImport("USER3 ...
- mysql之高可靠
6.mysql主-从备份 主-主备份,首先AB机要保持数据一致,即先手工备份A机数据,然后在B机上恢复,之后就很简单了,只需要在B机上创建一个同步账号,并在A机上输入B机的那些参数然后启动slave ...
- Beta版本冲刺——day3
No Bug 031402401鲍亮 031402402曹鑫杰 031402403常松 031402412林淋 031402418汪培侨 031402426许秋鑫 站立式会议 大将回归,基本功能接口也 ...
- http请求相关
1.POST方式向服务器发送AJAX请求时 设置请求头 application/x-www-form-urlencoded 2.表单上传文件时 设置请求头 multipart/form-d ...
- ionic 启用sass
转入ionic项目目录,命令行下执行:ionic setup sass 提示编译器未装: You have specified Ionic CI to set up sass.However, you ...
- My Demo Reels
Some elementary algorithms about discrete differential geometry http://www.cnblogs.com/yaoyansi/p/56 ...
- HBase设计与开发性能优化(转)
本文主要是从HBase应用程序设计与开发的角度,总结几种常用的性能优化方法.有关HBase系统配置级别的优化,这里涉及的不多,这部分可以参考:淘宝Ken Wu同学的博客. 1. 表的设计 1.1 Pr ...
- Windows服务器上使用bat定时执行php
windows上和linux上有一个类似的cmd和bat文件,bat文件类似于shell文件,执行这个bat文件,就相当于依次执行里面的命令(当然,还可以通过逻辑来实现编程),所以,我们可以利用bat ...
- hive 基本语法
本来想讲自己用到的写出来了,结果发现一个比较全面的文章已经介绍过了,那我就不在重新发明轮子了,我也跟着学习一下. 转自:http://jeffxie.blog.51cto.com/1365360/31 ...
- navicat 连接 oracle
环境:windows2008r2(x64) oracle 11.2.0.1 1.找到Oracle服务端的NetManager程序(一般在开始菜单->oracle->配置和移植工具)中,修改 ...