Delphi formatµÄÓ÷¨
Ò»¡¢Formatº¯ÊýµÄÓ÷¨
FormatÊÇÒ»¸öºÜ³£Óã¬È´ÓÖËƺõºÜ·³µÄ·½·¨£¬±¾ÈËÊÔͼ¶ÔÕâ¸ö·½·¨µÄ°ïÖú½øÐÐһЩ·Ò룬ÈÃËüÓÐÒ»¸öÍêÕûµÄ¸Åò£¬ÒÔ¹©´ó¼Ò²éѯ֮Óãº
Ê×ÏÈ¿´ËüµÄÉùÃ÷£º
function Format(const Format: string; const Args: array of const): string; overload;
ÊÂʵÉÏFormat·½·¨ÓÐÁ½¸öÖÖÐÎʽ£¬ÁíÍâÒ»ÖÖÊÇÈý¸ö²ÎÊýµÄ£¬Ö÷ÒªÇø±ðÔÚÓÚËüÊÇḬ̈߳²È«µÄ£¬µ«²¢²»¶àÓã¬ËùÒÔÕâÀïÖ»¶ÔµÚÒ»¸ö½éÉÜ£º
function Format(const Format: string; const Args: array of const): string; overload;
Format²ÎÊýÊÇÒ»¸ö¸ñʽ×Ö·û´®£¬ÓÃÓÚ¸ñʽ»¯ArgsÀïÃæµÄÖµµÄ¡£ArgsÓÖÊÇʲôÄØ£¬ËüÊÇÒ»¸ö±äÌåÊý×飬¼´ËüÀïÃæ¿ÉÒÔÓжà¸ö²ÎÊý£¬¶øÇÒÿ¸ö²ÎÊý¿ÉÒÔ²»Í¬¡£
ÈçÒÔÏÂÀý×Ó£º
Format('my name is %6s',['wind']);
·µ»Øºó¾ÍÊÇ
my name is wind
ÏÖÔÚÀ´¿´Format²ÎÊýµÄÏêϸÇé¿ö£º
FormatÀïÃæ¿ÉÒÔдÆÕͨµÄ×Ö·û´®£¬±ÈÈç'my name is' µ«ÓÐЩ¸ñʽָÁî×Ö·û¾ßÓÐÌØÊâÒâÒ壬±ÈÈç"%6s"
¸ñʽָÁî¾ßÓÐÒÔϵÄÐÎʽ£º
"%" [index ":"] ["-"] [width] ["." prec] type
ËüÊÇÒÔ"%"¿ªÊ¼,¶øÒÔtype½áÊø£¬type±íʾһ¸ö¾ßÌåµÄÀàÐÍ¡£ÖмäÊÇÓÃÀ´¸ñʽ»¯typeÀàÐ͵ÄÖ¸Áî×Ö·û£¬ÊÇ¿ÉÑ¡µÄ¡£
ÏÈÀ´¿´¿´type,type¿ÉÒÔÊÇÒÔÏÂ×Ö·û£º
d Ê®ÖÆÊý£¬±íʾһ¸öÕûÐÍÖµ
u ºÍdÒ»ÑùÊÇÕûÐÍÖµ£¬µ«ËüÊÇÎÞ·ûºÅµÄ£¬¶øÈç¹ûËü¶ÔÓ¦µÄÖµÊǸºµÄ£¬Ôò·µ»ØʱÊÇÒ»¸ö2µÄ32´Î·½¼õÈ¥Õâ¸ö¾ø¶ÔÖµµÄÊý
È磺Format('this is %u',[£2]);
·µ»ØµÄÊÇ£ºthis is 4294967294
f ¶ÔÓ¦¸¡µãÊý
e ¿Æѧ±íʾ·¨£¬¶ÔÓ¦ÕûÐÍÊýºÍ¸¡µãÊý£¬
±ÈÈçFormat('this is %e',[-2.22]);
·µ»ØµÄÊÇ£ºthis is -2.22000000000000E+000
µÈÒ»ÏÂÔÙ˵Ã÷Èç¹û½«ÊýµÄ¾«¶ÈËõС
g Õâ¸öÖ»ÄܶÔÓ¦¸¡µãÐÍ£¬ÇÒËü»á½«ÖµÖжàÓàµÄÊýÈ¥µô
±ÈÈçFormat('this is %g',[02.200]);
·µ»ØµÄÊÇ£ºthis is 2.2
n Ö»ÄܶÔÓ¦¸¡µãÐÍ£¬½«Öµ×ª»¯ÎªºÅÂëµÄÐÎʽ¡£¿´Ò»¸öÀý×Ó¾ÍÃ÷°×ÁË
Format('this is %n',[4552.2176]);
·µ»ØµÄÊÇthis is 4,552.22
×¢ÒâÓÐÁ½µã£¬Ò»ÊÇÖ»±íʾµ½Ð¡ÊýºóÁ½Î»£¬µÈÒ»ÏÂ˵ÔõôÏû³ýÕâÖÖÇé¿ö
¶þÊÇ£¬¼´Ê¹Ð¡ÊýûÓб»½Ø¶Ï£¬ËüÒ²²»»áÒ²ÏñÕûÊý²¿·ÖÒ»ÑùÓжººÅÀ´·Ö¿ªµÄ
m Ç®±ÒÀàÐÍ£¬µ«¹ØÓÚ»õ±ÒÀàÐÍÓиüºÃµÄ¸ñʽ»¯·½·¨£¬ÕâÀïÖ»ÊǼòµ¥µÄ¸ñʽ»¯
ÁíÍâËüÖ»¶ÔÓ¦ÓÚ¸¡µãÖµ
Format('this is %m',[9552.21]);
·µ»Ø£º
Ïà¹ØÎĵµ£º
µÚÒ»ÖÖ·½·¨£º
µÚÒ»²½£º ÐÞ¸ÄÊôÐÔ
1¡¢kind -> dtktime Ò²¿ÉÒÔÊÇdtkdate µ«ÊÇÔÚÓÃdtkdateµÄʱºòÐèÒª½«datemodeÊôÐÔÐ޸ijÉdmUpDown
2¡¢parseinput -> true
µÚ¶þ²½£ºÔÚonUserInputʼþÖÐдһ¾ä´úÂë
DateTimePicker1.DateTime:=DateAndTime;
×¢£ºÒÔÉÏ·½·¨ËäÈ»¿ÉÒԴﵽĿµÄ£¬µ ......
Èç½ñRealPlayerµÄÁ÷ʽýÌåÎļþÒÔÆäÇ¿´óµÄÊÓƵѹËõ±ÈÕýÖð²½ÇÄÈ»ÐËÆð¡£RealPlayer Plus²¥·ÅÆ÷Ò²ÀíËùµ±È»µØ³ÉΪ´ó¼Ò²¥·ÅRealPlayer¸ñʽÎļþµÄÊ×Ñ¡Èí¼þ¡£²»¹ýRealPlayer PlusÒ²²»ÊÇʮȫʮÃÀµÄ£¬±ÈÈçÆô¶¯Ê±¼äÂý£¬Õ¼Óÿռä´ó£¬ÁôÓÐÀúÊ·¼Ç¼µÈµÈ¡£ÆäʵÎÒÃÇ¿ÉÒÔÀûÓÃDelphi´òÔìÒ»¸öÍêÈ«·ûºÏ×Ô¼ºÒªÇóµÄRealPlayer² ......
unit MyADO;
interface
uses
SysUtils, Classes,ADODB,DB,Variants,StdCtrls,Dialogs;
type
TMyADO = class(TComponent)
private
Connection: TADOConnection;
Query: TADOQuery;
Table: TADOTable;
FConnectio ......
ÓÃDelphi¿ª·¢Êý¾Ý¿âÓ¦Óã¬Ò»°ã»áÉæ¼°µ½ÉÁÆÁ£¨Splash£©¡¢µÇ¼´°¿Ú¡¢Ö÷Êý¾ÝÄ£¿é£¨»òÖ÷Êý¾Ý¿âÁ¬½Ó£©ÒÔ¼°Ö÷´°¿Ú¡£Í¨³£ÔÚÏîÄ¿ÎļþÖУ¬splash´°¿ÚÏÔʾ¹ý£¬Ò»Ð©ÐèÒª¼ÓÔصÄ×ÊÔ´¡¢´°¿Ú¼ÓÔعýºó£¬Application.Run֮ǰ£¬½øÐÐÓû§µÇ¼¡£
//²âÊÔCSDN²©¿Í¶ÔDELPHI´úÂëµÄÖ§³Ö
program TEST;
uses
Forms,
Windows,
MainF in 'Ma ......
//¶¨ÒåÈ«¾Ö±äÁ¿
public
{ Public declarations }
outlook,MailItem,Recipient:variant;
OutlookNameSpace:variant;
OutlookFolder:variant;
OutlookAttachment:variant;
//´´½¨´ò¿ªoutlook
procedure TForm1.CreateOutLook;
begin
try
outlook:=CreateOleObject('OutLook.app ......