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

DelphiÖÐFormat×Ö·û´®ËµÃ÷

DelphiÖÐFormat×Ö·û´®ËµÃ÷
function Format(const Format: string; const Args: array of const):
string;
Format×Ö·û´®ËµÃ÷£º
"%" [index ":"] ["-"] [width] ["." prec] type
(1)
¸ñʽ»¯×Ö·û´®±ØÐëÒÔ%¿ªÍ·
(2) [index ":"]
Ë÷ÒýÖ¸µÄÊÇArgs²ÎÊýÁбíÖÐÒªÏÔʾµÄÿһÏîµÄÐòºÅ¡£±ÈÈ磺ArgsÊÇ
                 
['a',
'c']£¬ÄÇô'a'µÄË÷Òý¾ÍÊÇ0£¬¶ø'c'µÄË÷Òý¾ÍÊÇ1£¬¶øÇÒÓÉÓÚÖ»ÓÐ
                 
Á½ÏËùÒԾͲ»»á³öÏÖ´óÓÚ1µÄË÷ÒýÖµ¡£
                 
Format('%2:s %1:s %0:s', ['1st', '2nd',
'3rd']);
                 
½á¹û£º'3rd 2nd 1st'
(3) ["-"]
Õâ¸ö±êʶ·ûµÄ×÷ÓÃÊǵ±ÒªÏÔʾµÄ×Ö·ûµÄ¸öÊýÉÙÓÚ[width]ʱ£¬ÔÚÓÒ±ßÌî²¹¿Õ¸ñ£»
           
Èç¹ûû¼ÓÉÏ["-"]£¬ÔòÔÚ×ó±ßÌî²¹¿Õ¸ñ¡£
           
Format('(%4s)', ['aa']); ½á¹û£º' aa'
(4) [width]
¿í¶È
             
¹æ¶¨ÁËÒªÏÔʾµÄ×Ö·ûµÄ¸öÊý¡£Èç¹ûÒªÏÔʾµÄ¿í¶È´óÓÚ[width]£¬Ôò°´Êµ¼ÊµÄ
             
¿í¶ÈÀ´ÏÔʾ£»·´Ö®£¬ÔòÌî²¹¿Õ¸ñ»ò°´ÒªÇóÌî²¹ÆäËü×Ö·û¡£
(5) ["." prec]
¾«¶È
                
ÕâÊÇÕë¶Ô¸¡µãÊýÀ´ËµµÄ£¬Ò»°ã¾ÍÊÇָСÊýµãºóµÄλÊý¡£
(6) type ÀàÐÍ(¼ûÏÂÃæ)
typeµÄ¿ÉÄÜÖµÓÐÏÂÁÐÕâЩ£º
(1) d
ÓзûºÅÊ®½øÖÆÊý
       
Args±ØÐëÊÇÓзûºÅÕûÐÍÊý¡£Èç¹ûÔÚ¸ñʽ»¯×Ö·û´®Öл¹¼ÓÈëÁË["."
prec]£¬ÔòÈç¹ûArgs
       
µÄ³¤¶ÈÈç¹ûСÓÚ¸ø³öµÄ¾«¶ÈÊýʱ£¬ÔÚǰ±ßÌî²¹0£»Èç¹û´óÓÚ¾«¶ÈÊý£¬°´Êµ¼Ê³¤¶ÈÏÔÊ


Ïà¹ØÎĵµ£º

delphi ±àдµÄcom ¶ÔÏó ÓÃdelphi µÄµ÷ÓÃʵÀý

delphi ±àдµÄcom ¶ÔÏó ÓÃdelphi µÄµ÷ÓÃʵÀý
COM ¶ÔÏóÓë ǰһƪÎÄÕ嵀 PHPµ÷ÓõÄCOMΪͬһ¸ö¶ÔÏ󣬹ʲ»Àý³öCOM.
procedure TForm1.Button4Click(Sender: TObject);
var
  myCounter, mReturn: variant;
begin
  myCounter := CreateOleObject('abc.myxml');
  mReturn := myCounter.xml;
 &nbs ......

delphi ×¢²á com ¶ÔÏóµÄ·½·¨

delphi ×¢²á com ¶ÔÏóµÄ·½·¨
procedure TForm1.Button3Click(Sender: TObject);
var
 Sd: TSecurityDescriptor;
 begin
   InitializeSecurityDescriptor(@Sd, SECURITY_DESCRIPTOR_REVISION);
    SetSecurityDescriptorDacl(@Sd, true, Nil, false);
    RegSe ......

¡¾×ª¡¿delphi¶ÁдtxtÎļþ

http://meidi152.blog.163.com/blog/static/5423302009610103610744/
 
1. memo¿Ø¼þ¶ÁÈ¡txt
memo1.Lines.LoadfromFile('E:\*\*.txt');
2.
Procedure NewTxt(FileName:String);
Var
F : Textfile;
Begin
if fileExists(FileName) then DeleteFile(FileName); {¿´ÎļþÊÇ·ñ´æÔÚ,ÔÚ¾Í刪³ý}
AssignFile(F, ......

Delphi in a Unicode World Part I

 ---
Delphi in a Unicode World Part I: What is Unicode, Why do you need
it, and How do you work with it in Delphi?
By: Nick
Hodges
Ô­ÎÄÁ´½Ó£ºhttp://dn.codegear.com/article/38437
Abstract: This article discusses Unicode, how Delphi developers
can benefit from using Unicode, and ho ......

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

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