Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

DelphiÖеÄTHashTable

ÔÚDelphiÖÐ,Inifilesµ¥ÔªÖÐÓÐÒ»¸öTStringHashµÄÀ࣬²»¹ýËüµÄValue½öÖ§³ÖInteger(ÆäʵҲ²»ÊÇÎÊÌ⣬ÓÐÆäËüÀàÐÍ¿ÉÒÔ½«±äÁ¿±äΪPointer)£¬ÓÐµã²»Êæ·þ£¬½ñÌìûÊÂ×ö¾Í°ÑËüÌæ»»ÎªvariantÁË£¬ÆäÖÐKeyµÄÃû³Æ´óСдÎ޹أ¬¾ÍÊÇΪÁ˼ӿ쿪·¢ËÙ¶È£¡
ʹÓÃHashtable,²éÕÒºÍɾ³ý¸´ÔӶȶ¼Êdz£Êý¼¶±ðµÄ!
type
PPHashItem = ^PHashItem;
PHashItem = ^THashItem;
THashItem = record
Next: PHashItem;
Key: String;
Value: Variant;
end;
THashTable = class
private
Buckets: array of PHashItem;
protected
function Find(const Key: String): PPHashItem;
function HashOf(const Key: String): Cardinal; virtual;
public
constructor Create(Size: Cardinal = 256);
destructor Destroy; override;
procedure Put(const Key: String; Value: Variant);
procedure Clear;
procedure Remove(const Key: String);
function Modify(const Key: String; Value: Variant): Boolean;
function Get(const Key: String): Variant;
function ContainKey(const Key: String):boolean;
end;
procedure THashTable.Clear;
var
I: Integer;
P, N: PHashItem;
begin
for I := 0 to Length(Buckets) - 1 do
begin
P := Buckets[I];
while P <> nil do
begin
N := P^.Next;
Dispose(P);
P := N;
end;
Buckets[I] := nil;
end;
end;
function THashTable.ContainKey(const Key: String): boolean;
var
P: PHashItem;
begin
P := Find(Key)^;
if P <> nil then
begin
Result := True;
end
else
Result := False;
end;
constructor THashTable.Create(Size: Cardinal);
begin
inherited Create;
SetLength(Buckets, Size);
end;
destructor THashTable.Destroy;
begin
Clear;
inherited Destroy;
end;
function THashTable.Find(const Key: String): PPHashItem;
var
Hash: Integer;
begin
Hash := HashOf(Key) mod Cardinal(Length(Buckets));
Result := @Buckets[Hash];
while Result^ <> nil do
begin
if Result^.Key = Key then
Exit
else
Result := @Result^.Next;
end;
end;
functio


Ïà¹ØÎĵµ£º

Delphi in a Unicode World Part II

Delphi in a Unicode World Part II:  New RTL Features and
Classes to Support Unicode
By: Nick
Hodges
Ô­ÎÄÁ´½Ó:http://dn.codegear.com/article/38498
Abstract: This article will cover the new features of the Tiburon
Runtime Library that will help handle Unicode strings.
//
 & ......

Delphi¿ç½ø³Ì·ÃÎÊDBGRID

´ËÎÄÊǸù¾Ý°éË®ÀÏ´óµÄʵÀý×öµÄСÐ޸ģ¡
ÒÔÏÂÊǸöÈ˼û½â£¬ÈçÓдíÎóÇëÖ¸Õý:)
      ÒªÏë¿ç½ø³Ì·ÃÎÊDBGRID£¬Ã²ËÆÖ»ÄÜÓÃHOOK£¬Ð´Ò»¸öDLLÏë°ì·¨×¢È뵽Ŀ±ê½ø³Ì¡£×¢Èë³É¹¦ºó£¬Ê¹DLLÓëÄ¿±ê½ø³ÌÔÚͬһ½ø³Ì¿Õ¼äÖÐ(ÆäÄÚÓÐһЩϸ½ÚÎÊÌ⣬Çë²Î¼û´úÂë)£¬Õâʱ¿ÉÒÔ·ÃÎÊÄ¿±ê½ø³ÌµÄVCL×é¼þ¡£²¢°ÑVCL×é¼þµÄÊý¾Ýͨ¹ ......

Delphi ·¢²¼ActiveX¿Ø¼þ Êý×ÖÇ©Ãû£¨×ª£©

Ô­×÷Õߣº¹âÃ÷ÐÖµÜ
×î½üÎÒÕýÔÚÑо¿ActiveX¼¼Êõ¡£ÎÒʹÓÃDelphi 7´´½¨ÁËÒ»¸ö¾ßÓÐActiveFormµÄActiveX¿Ø¼þÓ¦ÓóÌÐò¡£Õâ¸ö¿Ø¼þ²úÉúÒ»¸ö.OCXÎļþ¡£ÏÖÔÚ£¬ÎÒÐèÒª°ÑÕâ¸ö¿Ø¼þ²¿ÊðÔÚ·þÎñÆ÷¶Ë£¬ÔÚÓû§ä¯ÀÀÍøÒ³²¢Ñ¡Ôñ°²×°Õâ¸ö¿Ø¼þµÄʱºò£¬Óû§µÄIE²Å»áÏÂÔØ¡¢°²×°²¢ÏÔʾÕâ¸ö¿Ø¼þ¡£
µ«ÊÇÎҵĿؼþ±ØÐë×÷Êý×ÖÇ©ÃûÒÔºó£¬IE²Å»áÏÂÔØ°²×°¡£ ......

¹ØÓÚdelphi Moveº¯ÊýµÄÓ÷¨Ïê½â

  ʹÓÃdelphi¶àÄê,ǰЩÌìºöÈ»Óöµ½²»»ástringתpbyte,ºÜÊÇʧÂä,´Ëʱ¶ÔÓÚ±à³Ì»ù±¾¹¦µÄÖØÒªÐÔÉîÓÐÌå»á.ÕâÆäÖÐÓõ½MOVEº¯Êý.
 ¸ãÁ˺ÃÒ»»á²Å¸ãÃ÷°×ÆäÓ÷¨.ËùÒÔÏëÌù³öÀ´°ïÖúÐèÒª°ïÖúµÄÈË.
var
   s:string;
   ps:Pchar;
   b:pbyte;
   len:integer;
begin
 &nb ......

unix C ¡¢delphiµÄ¶àÓïÑÔÎı¾×Ö·û»»ÐеÄÎÊÌâ

½ñÌìÏîÄ¿×é·¢ÉúÒ»¸öÊÂÇé¾ÍÊÇ£¬ºǫ́aixÉ϶ԶàÓïÑÔÎı¾£¨Ó¢Óï+ºº×Ö£©»»ÐÐÎÊÌâ¸ã²»Ì«Çå³þ¡£
×îÔçǰ̨µÄ¶à×Ö·ûµÄ´úÂëÎÒ¼ì²éÁËһϣ¨°´ÕÕ0-128ÒÔÍâËãÖÐÎĵĴúÂ룩·¢ÏÖ²»Êǰ²È«µÄ´úÂë¡£
(delphi 7.0)
delphi°²È«µÄ»ìºÏ×Ö·ûµÄ²Ù×÷·½·¨ÊÇ£º
ÔÚstrsUtilsµ¥ÔªÖÐ
leftstr
MidStr
Rightstr
aixÏÂÊÇ£º ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ