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 dll ʵÀý Óë dll´°ÌåʵÀý
±¾¶¯Ì¬Á´½Ó¿â·½·¨ÓÐ
Min,Max,SynAPP,ShowForm,showmyform
dll¹¤³ÌÎļþ
Library Project1;
uses
dllUnit1 in 'dllUnit1.pas' {Form1};
function Min(X, Y: Integer): Integer; export;
begin
if X < Y then Min := X else Min := Y;
end;
function Max(X, Y: Integer): ......
dll µ÷Ó÷½·¨ÓÐ ¾²Ì¬µ÷ÓúͶ¯Ì¬µ÷ÓÃÁ½ÖÖ·½·¨
Óõ½µÄdllΪÉÏÆªÎÄÕÂËù±àдµÄdll.
×ܽáÈçÏ£º
Unit Unit1;
Interface
Uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
Type
TForm1 = Class(TForm)
Button1: TButton; ......
---
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 7Ö®ºóµÄ°æ±¾£¬Ôö¼ÓÁËÔËËã·ûµÄÖØÔØ¡£ËäÈ»²»¾¡ÈËÒ⣨ÐèÒªÐ´ÌØ¶¨Ó¢ÎÄ£©£¬µ«ÓÐ×ܱÈûÓÐÇ¿¡£
Àý£º
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
T3DPoint = record
X, Y, Z: Doub ......