À¨ºÅÆ¥Å䣨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;
Ïà¹ØÎĵµ£º
var
Form1: TForm1;
a, b, c: Integer;
implementation
{$R *.dfm}
procedure test1(x, y, z: integer);
asm
mov a,eax
mov b,edx
mov c,ecx
end;
procedure test2(x, y, z: integer);
var
i,j,k: integer;
asm
mov i,eax
mov j,edx
mov k,ecx
mov eax,[esp+8]
mov a,eax
mov ......
DelphiµÚÈý·½¿Ø¼þ°²×°Ð¶ÔØÖ¸ÄÏ
»ù±¾°²×°
1¡¢¶ÔÓÚµ¥¸ö¿Ø¼þ£¬Componet-->install component..-->PAS»òDCUÎļþ-->install;
2¡¢¶ÔÓÚ´ø*.dpkÎļþµÄ¿Ø¼þ°ü£¬File-->Open(ÏÂÀÁбí¿òÖÐÑ¡*.dpk)-->install¼´¿É£»
3¡¢¶ÔÓÚ´ø*.bplÎļþµÄ¿Ø¼þ°ü£¬Install Packages-->Add-->bplÎļþÃû¼´¿É£»
4¡¢Èç¹ ......
Ò»¡¢DelphiÖÐÁ÷µÄ»ù±¾¸ÅÄî¼°º¯ÊýÉùÃ÷
ÔÚDelphiÖУ¬ËùÓÐÁ÷¶ÔÏóµÄ»ùÀàΪTStreamÀ࣬ÆäÖж¨ÒåÁËËùÓÐÁ÷µÄ¹²Í¬ÊôÐԺͷ½·¨¡£
TStreamÀàÖж¨ÒåµÄÊôÐÔ½éÉÜÈçÏ£º
1¡¢Size:´ËÊôÐÔÒÔ×Ö½Ú·µ»ØÁ÷ÖÐÊý¾Ý´óС¡£
2¡¢Position:´ËÊôÐÔ¿ØÖÆÁ÷ÖдæÈ¡Ö¸ÕëµÄλÖà ......
רÃÅÕë¶ÔdelphiµÄ£¬Ç¶ÈëÔ´ÂëµÄ²¡¶¾
Èç¹ûÔÚ X:\Program Files\Borland\Delphi7\Lib ·¢ÏÖÓÐ SysConst.bak (12KB) ºÍ
SysConst.dcu (18KB)£¬ÄÇô¹§Ï²Ä㣬ÖÐÕÐÁË¡£
http://topic.csdn.net/u/20090817/20/102ba10b-82ae-472d-a0be-6d54ce6a331b.html
http://bbs.2ccc.com/topic.asp?topicid=330829
http://bbs.2ccc.com/top ......