Delphi±àд±ä³¤²ÎÊýµÄcdeclº¯Êý
ÎÄÕÂÀ´×Ô£ºhttp://hi.baidu.com/523399/blog/item/f36e2e9b25041fbdc9eaf4c6.html
ѧ¹ýCÓïÑÔµÄÈ˶¼ÖªµÀ£¬printfµÄ²ÎÊýÊDz»¹Ì¶¨µÄ£¬ÕâÖÖ²ÎÊýÐÎʽ½Ð×ö±ä³¤²ÎÊý¡£´øÓб䳤²ÎÊýµÄº¯Êý±ØÐëÊÇcdeclµ÷ÓÃÔ¼¶¨£¬Óɺ¯ÊýµÄµ÷ÓÃÕßÀ´Çå³ýÕ»£¬²ÎÊýÈëÕ»µÄ˳ÐòÊÇ´ÓÓÒµ½×ó¡£printfÊǸù¾Ý¸ñʽ»¯´®ÖеÄռλ±ê¼ÇÀ´²Â²âÕ»ÖеIJÎÊýµÄ¡£ÒÔϾÍÓÃDelphiÄ£ÄâÒ»¸ö¼òµ¥µÄÀàËÆprintfµÄº¯Êýsprintf¡£
type
VA_FN = function(const par1, par2{, ...}: Pointer): Integer; cdecl varargs;
procedure CvtInt;
{ IN:
EAX: The integer value to be converted to text
ESI: Ptr to the right-hand side of the output buffer: LEA ESI, StrBuf[16]
ECX: Base for conversion: 0 for signed decimal, 10 or 16 for unsigned
EDX: Precision: zero padded minimum field width
OUT:
ESI: Ptr to start of converted text (not start of buffer)
ECX: Length of converted text
}
asm
OR CL,CL
JNZ @CvtLoop
@C1: OR EAX,EAX
JNS @C2
NEG EAX
CALL @C2
MOV AL,'-'
INC ECX
DEC ESI
MOV [ESI],AL
RET
@
Ïà¹ØÎĵµ£º
DelphiÕýÔò±í´ïʽѧϰ£¬²Î¿¼CSDNÍòÒ»ÀÏʦµÄBLOG¡¢CSDN¡¢ÍøÂç×ÊÁÏÒÔ¼°´øÔ´ÂëµÄTPerlRegEx£¬ÔÚ´Ë×¢Ã÷£¬ÒÔºó²»ÔÙ˵Ã÷£¬ÔÚЩ¸ÐлGoogleÀÏʦºÍ°Ù¶ÈÀÏʦ
°²×°£º
ÏÂÔØµØÖ·£ºhttp://download.csdn.net/source/1668436
1¡¢°²×°.dpkÎļþ£¬ÔÚLibaryÖÐÌí¼ÓTPerlRegExµ¥Ôª´æ·Å·¾¶
2¡¢ÔËÐгÌÐòǰ¸´ÖÆpcrelib.dllµ½C:\WINDOWSÏ ......
ÀûÓÃWindows APIº¯ÊýWritePrivateProfileString ºÍGetPrivateProfileString¿É¶Ô.INIÎļþ½øÐжÁд²Ù×÷¡£Æäʵ£¬¶Ô.INIÎļþµÄ¶ÁдÍêÈ«¿ÉÒÔÀûÓÃDelphiµÄÄÚÖú¯ÊýÀ´ÊµÏÖ¡£ÏÂÃæ¾Í½éÉÜһЩ¶Ô.INIÎļþ¶ÁдʱÏà¹ØµÄÀ༰ÆäÊôÐÔ·½·¨¡£
1¡¢TIniFile¶ÔÏó
ÒÔDelphiÖУ¬¶¨ÒåÁËÒ»¸öTIniFile¶ÔÏ󣬽«.INIÎļþ·â×°ÔÚÆäÖУ¬²¢ÌṩһЩ·½·¨£ ......
·þÎñ¶Ë£ºÌí¼ÓADOConnection£¬ADOQuery1£¬ADOQuery2¡£ÉèÖÃADOQuery1ΪÖ÷±í£¬ADOQuery2Ϊ´Ó±í¡£(ͨ¹ý ADOQuery2.SQL.Text:= 'select * from ´Ó±í where FKID=:Ö÷±íPKID'ÉèÖÃ)¡£Ìí¼ÓDataSetProvider1ºÍDataSetProvider2·Ö±ðÁ¬½Óµ½ADOQuery1ºÍADOQuery2¡£
¿Í»§¶Ë£ºÌí¼ÓClientDataSet1£¬ClientDataSet2¡£ClientDataS ......
³£ÓÿؼþÃüÃûǰ׺
¿Ø¼þÀàÃû
ǰ׺
TFormµÈ´°ÌåÀà
frm
TButton, TSpeedButtonµÈËùÓеİ´Å¥Àà
btn
TCheckBoxµÈËùÓеļì²é¿ò
chk
TRadioButtonµ¥Ñ¡°´Å¥Àà
rdo
TListBoxµÈËùÓеÄÁбí¿òÀà
lst
TPanelµÈËùÓеÄÃæ°åÀà
pnl
TLabel, TStaticTextµÈËùÓÐÓÃÀ´ÏÔʾµÄ±êÇ©Àà
lbl
TE ......
procedure TForm1.Button1Click(Sender: TObject);
Var
Num: Integer;
Begin
Try
Num:=StrToInt(Edit1.Text);
Edit2.Text:=IntToStr(Num*Num);
Except
On EConvertError Do ShowMessage(Edit1.Text+'ÎÞ·¨×ª³ÉÕûÊý!');
......