Ë˵DelphiûÓйþÏ£
Ë˵DelphiûÓйþÏ££¿££DelphiÖУ¬TStringListºÍTHashedStringListµÄÐÔÄܶԱÈ
Ôø¾¿´µ½ºÜ¶àÈËÔÚÈÂÈÂDelphiûÓйþÏ£±í£¬ÕâЩÈ˵Ķ¯ÊÖÒâʶ¹ÃÇÒ²»ÂÛ£¬È´»¹ÓкܶàÈËÒÔ´ËÀ´Ö¤Ã÷Delphi±È±ðµÄÓïÑÔÀ¬»ø£¬ÊµÔÚÊÇ...
ºÃ£¬ÀÎɧ´òס£¬×ª½ÓÕýÌâ¡£
TStringListÊÇÎÒÃdz£ÓõÄ×Ö·û´®ÁбíÀàÐÍ£¬Ó÷¨¾Í²»ÔÚÕâÀï׸Êö£¬µ«ÊÇ£¬ÔÚÊý¾ÝÆäÏîÊýÔö¶àʱ£¬ÆäËÑË÷£¨Ö÷ÒªÊÇname/keyËÑË÷ºÍindexofËÑË÷£©ÐÔÄܻἱ¾çϽµ£¬ÔÒòÊÇTStringListµÄÄÚ²¿´æ´¢Ê¹ÓÃÁËÁ´±íÐÎʽ£¬¶øËÑË÷²Ù×÷ʹÓÃÁËÑ»·±éÀú·½Ê½¡£
ÖµµÃ¸ßÐ˵ÄÊÇ£¬ÔÚiniFilesµ¥Ôª£¬DelphiΪÎÒÃÇÌṩÁËTHashedStringListÀàÐÍ£¬¼´£¬¾¹ý¹þÏ£´¦ÀíµÄTStringList£¬Ëü¼Ì³Ð×ÔTStringList£¬Ö»ÊǶÔËÑË÷·½·¨½øÐÐÁËÓÅ»¯£¬Òò´Ë£¬ÎÒÃÇÍêÈ«¿ÉÒÔ·ÅÐĵÄÔÚ´óÁ¿×Ö·û´®ËÑË÷µÄʱºòʹÓÃËüÀ´´úÌæTStringList£¬¶øÐèÒª¸Ä±äµÄÖ»ÊÇÔÚ:=µÄºóÃæÓÃTHashedStringList.createÀ´´úÌæTStringList.create£¬µ«ÆäËÙ¶ÈÈ´Ìá¸ßÁËÒ»¸öÊýÁ¿¼¶¡£
ΪÁËÏÔʾÁ½Õß¼äÐÔÄܵIJî¾à£¬ÎÒдÁ˼¸¸ö¼òµ¥µÄÓï¾äÀ´²âÊÔËûÃǸ÷×ÔµÄÌØÐÔ¡£
unit ufrmMainForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, StrUtils,IniFiles;
type
TForm1 = class(TForm)
btn1: TButton;
mmo1: TMemo;
procedure btn1Click(Sender: TObject);
private
...{ Private declarations }
public
procedure testTHashStringList;
procedure testTStringList;
...{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses DateUtils;
...{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
begin
testTStringList;
mmo1.Lines.Add('--------------------');
testTHashStringList;
end;
procedure TForm1.testTHashStringList;
var
hsl: THashedStrin
Ïà¹ØÎĵµ£º
ûÓÐÓ¦ÓÃ״̬ģʽµÄ´úÂë
1. ¹¤³ÌÎļþ
program Project1;
{$APPTYPE CONSOLE}
uses
uGumballMachine in 'uGumballMachine.pas';
var
aGumballMachine: TGumballMachine;
begin
aGumballMachine := TGumballMachine.Create(5);
aGumballMachine.InsertQuarter;
aGumballMachine.TurnCrank;
Writeln; ......
´ó¼Ò¶¼ÈÏΪ£¬CÓïÑÔÖ®ËùÒÔÇ¿´ó£¬ÒÔ¼°Æä×ÔÓÉÐÔ£¬ºÜ´ó²¿·ÖÌåÏÖÔÚÆäÁé»îµÄÖ¸ÕëÔËÓÃÉÏ¡£Òò´Ë£¬ËµÖ¸ÕëÊÇCÓïÑÔµÄÁé»ê£¬Ò»µã¶¼²»Îª¹ý¡£Í¬Ê±£¬ÕâÖÖ˵·¨Ò²ÈúܶàÈ˲úÉúÎó½â£¬ËƺõÖ»ÓÐCÓïÑÔµÄÖ¸Õë²ÅÄÜËãÖ¸Õë¡£Basic²»Ö§³ÖÖ¸Õ룬Ôڴ˲»ÂÛ¡£Æäʵ£¬PascalÓïÑÔ±¾ÉíÒ²ÊÇÖ§³ÖÖ¸ÕëµÄ¡£´Ó×î³õµÄPascal·¢Õ¹ÖÁ½ñµÄObject Pascal£¬¿ÉÒÔ˵ÔÚÖ¸ÕëÔËÓ ......
Ãû³Æ ÀàÐÍ ËµÃ÷
abort º¯Êý ÒýÆð·ÅÆúµÄÒâÍâ´¦Àí
abs º¯Êý ¾ø¶ÔÖµº¯Êý
addexitproc º¯Êý ½«Ò»¹ý³ÌÌí¼Óµ½ÔËÐÐʱ¿âµÄ½áÊø¹ý³Ì±íÖÐ
addr º¯Êý ·µ»ØÖ¸¶¨¶ÔÏóµÄµØÖ·
adjustlinebreaks º¯Êý ½«¸ø¶¨×Ö·û´®µÄÐзָô·ûµ÷ÕûΪcr/lfÐòÁÐ
align ÊôÐÔ Ê¹¿Ø¼þλÓÚ´°¿Úij²¿·Ö
alignment ÊôÐÔ ¿ ......
Delphi formatµÄÓ÷¨
Ò»¡¢Formatº¯ÊýµÄÓ÷¨
FormatÊÇÒ»¸öºÜ³£Óã¬È´ÓÖËƺõºÜ·³µÄ·½·¨£¬±¾ÈËÊÔͼ¶ÔÕâ¸ö·½·¨µÄ°ïÖú½øÐÐһЩ·Ò룬ÈÃËüÓÐÒ»¸öÍêÕûµÄ¸Åò£¬ÒÔ¹©´ó¼Ò²éѯ֮Óãº
Ê×ÏÈ¿´ËüµÄÉùÃ÷£º
function Format(const Format: string; const Args: array of const): string; overload;
ÊÂʵÉÏFormat·½·¨ÓÐÁ½¸öÖÖÐÎʽ£¬Á ......