À¨ºÅÆ¥Å䣨delphi£©£×ª
type
TCharStack = class(TStack)
private
function GetTop: Char;
public
function Pop: Char;
function Push(Item: Char): Char;
property Top: Char read GetTop;
end;
const
FindSet = ['(',')'];
implementation
{$R *.dfm}
{ TCharStack }
function TCharStack.GetTop: Char;
begin
Result := Char(Peek);
end;
function TCharStack.Pop: Char;
begin
Result := Char(inherited Pop);
end;
function TCharStack.Push(Item: Char): Char;
begin
Result := Char(inherited Push(Pointer(Item)));
end;
function FindFirstOf(const Str: String; const CharSet: TSysCharSet; StartPos: Integer = 1): Integer;
begin
Result := StartPos;
while (Result <= Length(Str)) and not (Str[Result] in CharSet) do
Inc(Result);
if Result > Length(Str) then
Result := 0;
end;
function Check(Line: string): Boolean;
var
Stack: TCharStack;
Pos: Integer;
begin
Result := False;
Stack := TCharStack.Create;
try
Pos := FindFirstOf(Line, FindSet);
while(Pos <> 0) do
begin
case Line[Pos] of
'(':
Stack.Push(Line[Pos]);
')':
if (Stack.Count = 0) or (Stack.top <> '(') then
begin
ShowMessage('ÓÒÀ¨ºÅÆ¥Åä²»³É¹¦: ' + Copy(Line, 1, Pos));
Exit;
//Halt;
end
else
Stack.Pop();
end;
Pos := FindFirstOf(Line, FindSet, Pos +1);
end;
if Stack.Count > 0 then
ShowMessage('×óÀ¨ºÅÆ¥Åä²»³É¹¦!')
else
Result := True
finally
Stack.Free;
end;
end;
Ïà¹ØÎĵµ£º
ΪÁ˼ӿìÓ²¼þµÄ·ÃÎÊËÙ¶È, ±àÒëÆ÷ͨ³£ÒªÊ¹ÓÃ"Êý¾Ý¶ÔÆë", Æ©Èç:
//ÏÂÃæ½á¹¹ÖÐ: SizeOf(TRec) = 6; ÒòΪ b ÔÚÕâÀïÒ²ÒªÕ¼ 2 ×Ö½Ú.
TRec = record
a: Word;
b: Byte;
c: Word;
end
;
//ÏÂÃæ½á¹¹ÖÐ: SizeOf(TRec) = 16; ÕâÀïµÄ a ºÍ b ¹²Õ¼ÁË 8 ¸ö×Ö½Ú.
TRec = record
a: Byte;
b: Byte;
c: Do ......
Èç¹û²ÎÊýÔÚº¯ÊýÖв»¿ÉÄÜÐÞ¸Ä, Ò»¶¨ÒªÊ¹Óà const;
²»È», ±àÒëÆ÷¾Í»á:
¼Ù¶¨ÏÈÐÞ¸Ä, ÏÈÒª±¸·Ý; ʹÓÃÇ°ºóÒªÔö¼õÒýÓüÆÊý; »¹ÒªÌ×ÉÏ try finally.
Ö¸¶¨ÁË const ¾Í¿ÉÒÔ±ÜÃâÒÔÉϹý³Ì´Ó¶øÌá¸ßЧÂÊ.
unit
Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs ......
1)JEDI - VCL
JEDI-VCL(JVCL) ¿â¹¹½¨ÓÚ JEDI ÉçÇø¾èÔùµÄ´úÂë¡£ËûÓɳ¬¹ý 400 ¸ö¿ÉÒÔÔÚÄãµÄ Delphi ºÍ Kylix ÏîÄ¿ÖÐÁ¢¼´ÖØÓõÄ×é¼þ¹¹³É¡£Õû¸ö JEDI VCL ÔÚ Mozilla ¹«¹²Ðí¿ÉÖ¤£¨MPL£©Ìõ¿îÏ·ַ¢£¬Ëû¿ÉÒÔ×ÔÓÉʹÓÃÓÚÃâ·ÑÈí¼þºÍ¹²ÏíÈí¼þ£¬ÒÔ¼°¿ª·ÅÔ´´úÂ빤³ÌºÍÉÌÒµÏîÄ¿¡£
ÍøÕ¾£ºhttp://jvcl.sourceforge.net
(2)RXLib
RxLib ......
Ñо¿ÁËÒ»ÏÂPop3µÄÓʼþ½ÓÊÕÐÒ飬ȻºóËæÊÖдÁËÒ»¸öPop3µÄÓʼþ½ÓÊտؼþ£¡Pop3µÄÓʼþÐÒéʵ¼ÊÉÏÊǺܼòµ¥µÄ£¬ÖªµÀÄǼ¸¸öÃüÁî¾ÍÐÐÁË£¬Óë·þÎñÆ÷Ö®¼ä
µÄ½»»¥ÊÇÒ»ÎÊÒ»´ðµÃ·½Ê½£¬¿ØÖÆÆðÀ´Ò²ÈÝÒ×£¬Ïà¶Ô¶øÑÔÓʼþ¸ñʽµÄ½âÎöµ¹ÊǸü¼ÓÂé·³Ò»µã£¡ÓÚÊÇÒ²±ã˳´ø׎«MIMEÓʼþ¸ñʽ¸øÊìϤÁËһϣ¡×ܹé˵À´£¬¹æÂÉÐÔ±È
½ÏÇ¿£¬ÏÈ»ñÈ¡×î´óµÄ¶¥²ã¿ò ......
½«Ô¶³Ì¿ØÖÆÓ¦ÓÃÓÚ½ÌѧÖУ¬ÒѳÉΪĿǰ¼ÆËã»ú»¯½ÌѧµÄÖØÒªÊֶΡ£Ò»¶¨ÓкܶàµÄÍø³æÏëÁ˽âÕâÖÖÍøÂç½Ìѧ·½Ê½µÄ±à³ÌÔÀí°É¡£ÔÚ´ËÎÒÃǾÍÒÔÒ»¸ö¼òµ¥µÄÔ¶³Ì¿ØÖƳÌÐò×÷ΪʾÀý£¬ËµÃ÷ÕâÖÖÍøÂç±à³ÌµÄ»ù±¾ÔÀí¡£±¾³ÌÐòÒÔDelphi±à³ÌΪÀý¡£
¡¡¡¡Æäʵ¸Ã³ÌÐòµÄ¹¤×÷»úÖƺܼòµ¥£¬ÊÜ¿Ø·½ÔËÐÐÒ»¸ö³ÌÐò£¬ÓÃÓÚÕìÌý¶Ë¿Ú²¢½ÓÊÕÊý¾Ý°ü£¬¶øÖ÷¿Ø·½Í¨¹ý¶ ......