«¬ºA(Types)
¦b³o¤@³¹¤¤§Ṳ́¶²ÐObject Pascal
¤¤ªº«¬ºA«Å§i¡A§i¶D§A°ò¥»ªº«¬ºA©w¸q¡A¦³µ²ºcªº«¬ºA¤Î«¬ºA¶¡ªºÃöÁp¡C«¬ºA«Å§i(type
declaration)
¦bObject Pascal¤¤¡A¨C¤@ÓÅܼƦb¨Ï¥Î«e³£¥²»Ý¥ý«Å§i¥¦ªº«¬ºA¡A¤@ÓÅܼƥi¥H°µ¨º¨Ç¹BãX¡A¥i¥HÀx¦s¤°»ò¼Ëªº¸ê®Æ¡A³£¬O¥Ñ¥¦ªº«¬ºµ¨Ó¨M©wªº¡C°£¤FObject
Pascal¤w¸g«Å§iªº¤@¨Ç°ò¥»«¬ºA¥~¡A§Ṳ́]¥i¥Hµø»Ýn©w¸q¥X¦Û¤v»Ýnªº«¬ºA¡C
Åý§ÚÌ¥ý¬Ý¬Ý«¬ºA«Å§iªº¨Ò¤l:
type
ScoreRange=0..100 ;
string20=string[20] ;
ErrorList=array[0..20] of string20 ;
Season=(spring, summer, autumn , winter) ;
«O¯d¦rtype«á±ªº«Å§i¡A¥Nªí§Ú̦ۦæ©w¸qªº«¬ºAÃþ§O¡C½Ðª`·N¡A¦b³oùثŧiªº¤£¬OÅܼơA¦Ó¬O¤@ºØ«¬ºA¡A¥»¨¨Ã¤£¦û¥Î°O¾ÐÅé¡A¥²¶·µ¥¨ì«Å§i³o¤@ºØ«¬ºAªºÅܼƲ£¥Í«á¡A¤~·|¦V¨t²În¨D°O¾ÐÅé¨ÓÀx¦sÅܼƪº¸ê®Æ¡C³Ì«á¡A¤]¬O³Ì«nªº¡AÁ`¬On¦³¤@¨Ç³Ì°ò¥»ªº«¬ºA¡A§Ṳ́~¯à¦A¥[¥HÅܤƥX§ÚÌ©Ò»ÝnªºªF¦è¡C©³¤U§ÚÌ´N±qObject
Pascal¤w¸g©w¸q¦nªº«¬ºA¶}©l¤¶²Ð°_.
²³æ«¬ºA(simple types)
³o¤@Ãþªº«¬ºA¥]§t¦³¾ã¼Æ(integer)¡B¹ê¼Æ(real)¡B¦r¤¸(character)¡B¦CÁ|(enumerated)¡B¥¬ªL(boolean)¤Î¤l½d³ò(subrange)µ¥¤CºØ«¬ºA¡C°£¤F¹ê¼Æ¥~¡A¨ä¾l¤»ºØ§Ṳ́]ºÙ¬°§Ç¼Æ«¬ºA(ordinal
types)¡A§Ç¼Æ«¬ºA³Ì¥Dnªº¯S©Ê´N¬O¨ã¦³¶¶§Ç©Ê¡AȪº¤j¤p´N¥Nªí¨ä¶¶§Ç¡A³q±`°£¤F§Ç¼Æ¥»¨ªº·N¸q¥~¡A§Ṳ́]¸g±`§Q¥Î§Ç¼Æ³oºØ¯S©Ê¡A§â¥¦®³¨Ó·í¯Á¤Þ¨Ï¥Î¡A§Ú̱ߤ@ÂI·|¤¶²Ð¹ê»Úªº¨Ò¤l¡C©³¤UÁÙ¬O¥ý¤¶²Ð²³æ«¬ºA¡C
¾ã¼Æ«¬ºA
³¡¥÷«¬ºA¬O»P§@·~Àô¹Ò¬ÛÃö¡A¦b16¦ì¤¸ª©¥»©M32¦ì¤¸ª©¥»¤U©Ò¯à¨Ï¥ÎªºÀx¦s®æ¦¡¤£¦P,
§Ú̺٬°¤@¯ë«¬ºA(Generic Types)¡C¦Ó»P§@·~Àô¹ÒµLÃöªº¡A§Ú̺٬°°ò¦«¬ºA(Fundamental
Types)¡C¦UºØ¾ã¼Æ«¬ºAªº¦WºÙ¤Î¨ä¼ÆȽd³ò¾ã²z¦p¤U:
°ò¦«¬ºA
«¬ºA¦WºÙ ³Ì¤pÈ ³Ì¤jÈ
¨Ï¥Î¦ì¤¸²Õ
byte 0 255 1
shortint -128 127 1
smallint -32768 32767 2
word 0 65535 2
longint -2147483648 2147483647 4
¤@¯ë«¬ºA¦bDelphi 16¦ì¤¸ª©¥»¤U
«¬ºA¦WºÙ ³Ì¤pÈ ³Ì¤jÈ
¨Ï¥Î¦ì¤¸²Õ
integer -32768 32767 2
cardinal 0 65535 2
¤@¯ë«¬ºA¦bDelphi 32¦ì¤¸ª©¥»¤U
«¬ºA¦WºÙ ³Ì¤pÈ ³Ì¤jÈ
¨Ï¥Î¦ì¤¸²Õ
integer -2147483648 2147483647 4
cardinal 0 2147483647 4
¹ê¼Æ«¬ºA
³o¤@Ãþªº«¬ºA·|¦³ºë½T«×¤Wªº¨î¡A¦]¬°¨Ï¥Î¯BÂI¼Æ(floating-point)¨Ó°O¿ý¼ÆÈ,
©Ò¥H¦b°µ¹Bºâ®É¡A·|¦³¤@©wµ{«×ªº»~®t¡C¨Ò¦p¦³¥i¯à·|¥H0.99999999¨Ó¥N´À1.00000000¡CÃö©ó¦UºØ¯BÂI¼ÆªºÀx¦s®æ¦¡¡A½Ð¦Û¦æ°Ñ¦Ò¬ÛÃö®ÑÄy¡C¦UºØ¹ê¼Æ«¬ºAªº¦WºÙ¤Î¨ä¼ÆȽd³ò¾ã²z¦p¤U:
«¬ºA¦WºÙ ³Ì¤pÈ ³Ì¤jÈ
¦³®Ä¦ì¼Æ ¨Ï¥Î¦ì¤¸²Õ
single 1.5*10^-45 3.4 * 10^38 7-8
4
real 2.9 * 10^-39 1.7 * 10^38 11-12
6
double 5.0 * 10^-324 1.7 * 10^308
15-16 8
comp - 2^63 + 1 2^63 - 1 19-20
8
currency - (2^63) * 10^-4 (2^63 - 1) * 10^-4
19-20 8
extended 3.4 * 10^-4392 1.1 * 10^4932
19-20 10
O real ¬O¬°¤F¬Û®e©Êªº¦Ò¶q¦Ó¦s¦b¡A¦]¬°©Ò¨Ï¥Îªº®æ¦¡¦bIntel¨t¦CªºCPU¤W»Ýn¸g¹LÂà´«¤~¯à¹Bºâ¡A©Ò¥H¹Bºâªº³t«×¤ñ¸ûºC¡C
O comp¥u¯à°O¿ý¾ã¼Æ¡C
O currency¬O¬°¤Fª÷ÃBpºâ¤Wªº·Ç½T«×¦Ó©w¸q¥X¨Óªº«¬ºA¡C±Ä¥Î©wÂI¼Æ(fixed-point)¸ê®Æ«¬ºA¡C¯u¥¿¦b¹Bºâ®É¬O¥ý¼¤W10000¡A±N¼ÆÈÂର¾ã¼Æ«á¦A°µpºâ,
¦A¦^¦s®É¤~°£¤W10000¡A¦]¦¹¤£·|²£¥Íªñ¦üÈ»~®t¡C¦bDelphi 2.0
¤§«á¤~´£¨Ñcurrency«¬ºA¡C
O ¤Wªí°£¤Fcomp©Mcurrency¥~¡A³Ì¤pȳo¤@Äæ©Ò¦Cªº¼ÆȬ°¥¿¼Æ³Ì¤pÈ¡A¹ê»Ú¤Wªº³Ì¤pÈÀ³¬°³Ì¤jȳo¤@Äæ©Ò¦Cªº¼Æȼ¤W-1¡C
¦r¤¸«¬ºA
¦r¤¸«¬ºA©M¾ã¼Æ«¬ºA¦P¼Ë¦³¤@¯ë«¬ºA¤Î°ò¦«¬ºAªº°Ï¤À¡C
°ò¦«¬ºAAnsiChar»PWideChar¤À§O¨Ï¥Î³æ¡BÂù¦ì¤¸²Õ¨ÓÀx¦s¸ê®Æ¡CAnsiCharªº½d³ò´N¬O§Ṳ́@¯ë¨Ï¥ÎªºASCII
0..255¡CWideChar«h¬O¨Ï¥ÎUnicode¦r¤¸¶°¦Xªº¶¶§Ç¡C
¤@¯ë«¬ºAchar¤@ª½¨ìDelphi 2.0¤´¨Ï¥ÎAnsiChar¨Ó¥Nªí¨ä·N¸q¡C
¤£ºÞ¬O¥ô¦ó¸ê®Æ«¬ºA¡AYn¨ú±o¸ê®Æ«¬ºA©Ò¨Ï¥Îªº°O¾ÐÅé¤j¤p®É¡A¥i¥H¨Ï¥Î¼Ð·Ç¨ç¼Æsizeof¡C¦p¦¹¥iÁקKµ{¦¡¦b²¾Âà§@·~¥¥x®É¡A²£¥Ípºâ¤Wªº¿ù»~¡C
¦CÁ|«¬ºA
¦b»¡©ú¤°»ò¬O¦CÁ|«¬ºA«e, Åý§Ų́ӬݬݤU±³oÓ«¬ºA«Å§i:
type
Week=(Sun, Mon, Tue, Wed, Thu, Fri, Sat) ;
¦b³oùاÚ̫ŧi¤@Ó¦WºÙ¬°Week
ªº«¬ºA¡A¦b³oºØ«¬ºA¤¤¥]§t¦³¤CºØ¤¸¯À¡A³o¤CÓ¤¸ªí¬O¦³¶¶§Ç©Êªº¡A§ÚÌ¥i¥H¨Ï¥Îord³oӼзǨç¼Æ¨Ó¨ú±o¤¸¯À¦b³oÓ«¬ºA¤¤ªº¦ì¸m¡A¦b²Ä¤@Ó¦ì¸mªº¤¸¯À¶Ç¦^ȬO0¡A¨Ò¦pord(Sun)¶Ç¦^0¡Bord(Fri)¶Ç¦^5¡C
¯u¥¿ªºµ{¦¡¹ê§@¤¤,
¨Ï¥Î¦CÁ|«¬ºA¨Ã¤£·|¼W¥[µ{¦¡ªº³t«×©Î´î¤Öµ{¦¡©Ò¦ûªºªÅ¶¡¡A¥¦ªº»ùȦb©ó¼W¶iµ{¦¡ªº¥iŪ©Ê¡C¦CÁ|«¬ºA¦³ÂI¹³¬O±`¼Æ¡A¥[±j¤F¼¶¼gµ{¦¡ªº«K§Q¡A¦ý¬O¹ïµ{¦¡ªº°õ¦æ®Ä¯à¨S¦³¤°»ò¼vÅT¡C
¥¬ªL«¬ºA(boolean types)
¥¬ªL«¬ºA¥Dn¥Î©óµ{¦¡¬yµ{ªº§PÂ_(°j°é¡B±ø¥ó§PÂ_)¡C¦b¥¬ªL«¬ºA¤¤¥u¦³¨âºØÈ--true©Mfalse¡A¦b¤£¦PÃþ«¬ªº¥¬ªL«¬ºA¤¤¡A¹ïtrue©Mfalseªº©w¸q¤£¤Ó¬Û¦P¡A¤Uªí¦C¥X¤F¥¦Ìªº®t²§:
«¬ºA¦WºÙ False True «¬ºA©w¸q
¨Ï¥Î¦ì¤¸²Õ
Boolean false true ¦CÁ|«¬ºA
1
ByteBool 0 «D0 byte
1
WordBool 0 «D0 word
2
LongBool 0 «D0 longint
4
¦bµ{¦¡ªº¹ê§@¤¤¡A¥Î±o³Ì¦h¡A¤]³Ì¬Ù°O¾ÐÅ骺À³¸Ó´N¬Oboolean¡A¨ä¥¦¤TºØ¥Dn¬O¬°¤F»P¨ä¥¦µ{¦¡»y¨¥¬Û®eªº¦Ò¶q¦Ó«O¯dªº¡C
¤l½d³ò«¬ºA(subrange types)
¤@Ó¤l½d³ò«¬ºA¬O¤@Ó¥D½d³ò«¬ºA(host type)¤¤ªº¤@³¡¥÷¡A¥²»Ý¬O³sÄòªº§Ç¼Æ¨Ã³]©w³Ì¤pÈ©M³Ì¤jÈ¡A°£¦¹¤§¥~¥¦¨ã¦³¤@¤Á©M¥D½d³ò«¬ºA¬Û¦Pªº©Ê½è¡C©³¤U´N¬O¤@¨Ç¤l½d³ò«¬ºAªº½d¨Ò:
type
ScoreRange=0..100 ;
UpperCase='A'..'Z' ;
WorkDay=Mon..Fri ;
¤Wzªº¨Ò¤l¤¤¡A¤À§O¥Î¾ã¼Æ¡B¦r¤¸©M¦CÁ|©w¸q¥X·sªº¤l½d³ò«¬ºA¡C¤£¹L¦³¤@ÂInª`·N¡A¥u¦³¦b½sĶ®É¥´¶}½sĶ¿ï¶µRange
Checking(¦bOptions/Project/Compiler¤U)©Î¨Ï¥Î½sĶ«ü¥O{$R+}¤~·|¯u¥¿¥hÀˬd½d³ò¡A§_«h§Y¨Ï«ü©w¤@Ó¶W¹L½d³òªº¼ÆÈ¡A¤]¤£·|²£¥Í¿ù»~°T®§¡C
¦r¦ê«¬ºA(string types)
¦b16¦ì¤¸ª©¥»ªºDelphi¤¤¡A¥u¦³¤@ºØµu¦r¦ê(Short Strings)ªº®æ¦¡¡A¨ì¤F32¦ì¤¸ª©¥»«á¡A¤~¤S¦h´£¨Ñ¤Fªø¦r¦ê(Long
Strings)ªº¥\¯à¡C¦r¦ê«¬ºA¥Ñ«O¯d¦rstring©Ò«Å§iªº¡C¦b32¦ì¤¸ª©¥»ªºDelphi¤¤,
¦]¬°¦³ªø¦r¦ê¤Îµu¦r¦ê¨âºØ«¬ºA¡A©Ò¥H¦³¤@Ó½sĶ«ü¥O{$H+}ªí¥Üstring¥Nªí«Å§iªø¦r¦ê(¹w³]È)¡A{$H-}«hªí¥Ü«Å§i¬°µu¦r¦ê¡C¥H¤U§Ṳ́À§O¤¶²Ð¤GªÌªº¤£¦P¡C
µu¦r¦ê
µu¦r¦ê°£¤F¥i¥H¥Îstring¨Ó«Å§i¥~¡A¤]¥i¨Ï¥ÎDelphi¨Æ¥ý©w¸qªº«¬ºAShortString(32¦ì¤¸ª©¥»¤~¦³)¡C¥¦ªºªø«×¥²¶·¤¶©ó0¨ì255¤§¶¡¡A§Ú̦b«Å§iªº®ÉÔ¡A¥i¥H¥ý¨M©w¦r¦êªº³Ì¤jªø«×(¹w³]¬°255)¡A¤U¬°«Å§i©wªø«×µu¦r¦êªº½d¨Ò:
type
string10=string[10] ;
string100=string[100] ;
¤W±©Ò«Å§iªºstring10©Mstring100¤À§O¥Nªí³Ì¤jªø«×¬°10©M100ªºµu¦r¦ê¡AY«ü©w¤@Ó¶W¹L³Ì¤jªø«×ªº¦r¦ê¡A«h¶W¹Lªº³¡¥÷±N·|³Q±Ë±ó¡C
¤@Óµu¦r¦ê©Ò¦û¥Îªº°O¾ÐÅé¥]§t¤@Ӧ줸²Õ¨Ó°O¿ý¦r¦êªºªø«×(³o¤]´N¬O¬°¤°»òµu¦r¦ê³Ì¦h¥u¯à¦³255Ó¦r¤¸ªºì¦])¡A¦]¦¹¤@Óµu¦r¦ê¦û¥Îªº°O¾ÐÅ鬰
(«Å§iªø«×+1) ¡C
§ÚÌ¥i¥H¨Ï¥Î¯Á¤Þªº¤è¦¡¨ú¥X¦r¦ê¤¤ªºÓ§O¦r¤¸¡CÅý§ÚÌ¥ý¬Ý¬Ý¤U±³oÓµ{¦¡¤ùÂ_:
{$H-}
function rtrim(s:string):string ;
var
I : integer ;
begin
I:=ord(s[0]) ; // ¨ú¥X¦r¦êªø«×, ©M
I:=length(s)®ÄªG¬Û¦P
while s[I]=#32 do // ·í¦r¦êªº³Ì«á¤@Ó¦r¤¸¬°ªÅ¥Õ¦r¤¸(ASCII
32)
I:=I-1 ; //
¦r¦êªø«×´î¤@
s[0]:=chr(I) ; //
±N¥h°£§ÀºÝªÅ¥Õ«áªº¦r¦êªø«×¼g¦^¯Á¤ÞÈ0
Result:=s ; // ¶Ç¦^¥h°£§ÀºÝªÅ¥Õªº¦r¦ê
end ;
¤W±³oÓ¨ç¼Æ¡A¬O°w¹ïµu¦r¦êªº¯S©Ê©Ò¼gªº¡C¯Á¤ÞÈ0ªº¦ì¤¸²Õ°O¿ýµÛ³oÓ¦r¦ê¥Ø«eªºªø«×(¤£¥i¤j©ó«Å§i®É«ü©wªºªø«×¡A¤£«ü©w«h¬O255)¡A¥Ñ¦r¦ê¤¤³Ì«á¤@Ó¦r¤¸¶}©l¤ñ¸û,
ª½¨ì¤£¬OªÅ¥Õ¦r¤¸®É¡Aª½±µ±N¦r¦êªø«×¼g¤J¯Á¤ÞÈ0ªº¦ì¸m´N¥i§ïÅܦr¦êªºªø«×¤F¡C
¨Ï¥Î¯Á¤Þ¤è¦¡nª`·N¤@¥ó¨Æ¡A½sĶ¾¹¨Ã¤£·|Àˬd§A©Ò¨ú¥Xªº¦r¤¸¬O¤£¬O¦b«Å§iªº½d³ò¤º¡C¦]¦¹·í¦s¨ú¨ì°_¹L½d³òªº¦r¤¸®É¡Aµ{¦¡¨Ã¤£·|¥X²{¿ù»~¡A¦ýµLªk¹w´Á·|²£¥Í¤°»òµ²ªG¡C
¦bªø¦r¦ê¤¤¡A¦]¬°¨Ã¨S¦³¤@Ӧ줸ª½±µ°OµÛ¦r¦êªºªø«×¡A©Ò¥H´NµLªk¨Ï¥ÎÃþ¦üªº¤èªk¡C±µ¤U¨Ó§ÚÌ´N¶}©l¤¶²Ðªø¦r¦êªº¯S©Ê¡C
ªø¦r¦ê
¥Ñ©ó¤£¦A¨Ï¥Î¤@Ӧ줸²Õ¨Ó°O¿ý¦r¦êªø«×¡Aªø¦r¦êªº³Ì¤jªø«×²z½×¤W¥i¥Hªø¹F2GB(GigaBytes)¡A¨¬¥iº¡¨¬¦UÃþªº»Ýn¡C
°£¤F«O¯d¦rstring¥~¡A¤]¥i¥H¥Î¥t¤@Ó¨t²Î©w¸q¦nªºÃѧO¦rAnsiString¨Ó«Å§iªø¦r¦ê«¬ºA¡C§Ú̱Nªø¦r¦êªº¤@¨Ç¯S©Ê¾ã²z¦p¤U:
O
ªø¦r¦ê¬O±Ä¥Î°ÊºA°O¾ÐÅé°t¸m¡A¤£¥Î«Å§i³Ìªøªø«×¡A¨t²Î·|¦Û°Ê³B²z¬ÛÃöªº¹Bºâ¡C¤@Óªø¦r¦êÅܼƦû¥Î¤F¥|Ӧ줸²Õ¥H«ü¦V©Ò°t¸mªº°O¾ÐÅé¡A·í«ü©w¤@Ó·sªºÈµ¹ªø¦r¦ê®É¡A¨t²Î¥u¬O§ïÅÜ«ü¼Ð¦ì¸m¨Ã§ð¦³¯u¥¿ªº½Æ»s¦r¤¸¡A©Ò¥Hªø¦r¦ê¦b«ü©wȪº®ÉÔ³q±`³£¤ñµu¦r¦ê§Ö¡C
O ¦³¥i¯à¦hÓªø¦r¦êÅܼƫü¨ì¦P¤@¶ô°O¾ÐÅé¡A¦]¦¹Delphi¨Ï¥Î°Ñ¦Òp¼Æªº¤èªk¨Ó³B²z¡C·í«ü©w¤@Ó·sªºÈµ¹ªø¦r¦ê®É¡A¨t²Î·|±N«ü¦V¨º¤@¶ô°O¾ÐÅ骺°Ñ¦Òp¼Æ¥[¤@¡A¤Ï¤§ì¨ÓÂÂȪº°Ñ¦Òp¼Æ¾¹«h´î¤@¡C·í°Ñ¦Òp¼Æ¾¹¬°¹sªº®ÉÔ¡A³o¤@¶ô°O¾ÐÅé´NÄÀ¦^µ¹¨t²Î¡C
O
·í¨Ï¥Î¯Á¤Þªº¤è¦¡§ïÅܦr¦ê¤º®e®É¡A¦pªG°Ñ¦Òp¼Æ¤j©ó¤@¡A«h¨t²Î·|¥ý½Æ»s¤@¥÷¦r¦ê¦A§ó§ï¤º®e¡A¥HÁקK¼vÅT¨ì¨ä¥LªºÅܼơA³oºØ¤èªkºÙ¬°copy-on-write¡C
O ·í¤@Óªø¦r¦êè²£¥Í®É¡A³£·|³Q³]¦¨¤@ӪŦr¦ê¡C
O
·íªø¦r¦êªº¥Í©R¶g´Áµ²§ô®É¡A¤£ºÞ¬O¦]¬°¤°»òì¦]¡A°Ñ¦Òp¼Æ¾¹³£·|¦Û°Ê´î¤@¡C
O n¨ú±o©Î³]©wªø¦r¦êªºªø«×¡A¥²¶·¨Ï¥Î¼Ð·ÇªºPascal«ü¥Olength©MSetLentgh¡C
O ªø¦r¦ê¤£¯à¨Ï¥Îvarªº°Ñ¼Æ¶Ç»¼¤è¦¡¡A¤]¤£¯à¥X²{¦b¤@Ó°O¿ý«¬ºAªºÅܰʳ¡¥÷¡C(ì¦]³£¬O¦]¬°ªø¦r¦ê¥u¬O¤@Ó«ü¼Ð¡C)
O ªø¦r¦ê·|¦Û°Ê³Ì«á¤@Ó¦r¤¸«á¥[¤WªÅ¦r¤¸(ASCII 0)¡A©Ò¥HnÂà´«¦¨Pchar«¬ºA®É¡A¥un¥[¤W«¬§OÂà´«´N¥i¥H¤F¡C
¦b«ü©w©M¹Bºâ¦¡¤¤¡Aªø¦r¦ê©Mµu¦r¦ê¥i¥H²V¦X¨Ï¥Î¡A¦ý¬O¦b³Q·í¦¨°Ñ¼Æ¶Ç»¼®É«h»Ý°Ï¤À²M·¡¡C
¦r¦êªº¤ñ¸û¬O¥Ñ¬Û¹ïÀ³¦ì¸mªº¦r¤¸¨Ó¨M¦r¦êªº¶¶§Ç¡A½Ð°Ñ¦Ò¤U¦Cªº¨Ò¤l:
'AB' < 'BB' ; // ¥¿½T
'AA' < 'AAAa' ; // ¥¿½T
'ABC' < 'abc' ; // ¥¿½T
¦bObject Pascal Language Guideªº²Ä5³¹¤¤ÁÙ·|¤¶²Ð¨ì¦r¦êªº¹Bºâ¤Î¤ñ¸û¡AÃö©ó¦r¦ê§ÚÌ´N¥ý°Q½×¨ì³oùج°¤î¡C
µ²ºc«¬ºA(structure types)
¤@Ó¯à¾Ö¦³¤@Ó¥H¤W¼ÆȪº«¬ºA¡A§Ú̺٬°µ²ºc«¬ºA¡C¦bµ²ºc«¬ºA¤¤¤]¥i¥H¦³§ó¤U¤@¼hªºµ²ºc¡C²z½×¤W¤@Óµ²ºc«¬ºA¤¤¥i¥H¦³µL¦hÓµ²ºc¶¥¼h¡C
ÃöÁä¦rpacked
¥i¥H¨Ïµ²ºc«¬ºA¦û¥Î¸û¤ÖªºªÅ¶¡¡A·íµM¥N»ù´N¬O¦s¨ú®É¥i¯ànªá¤W¸û¦hªº®É¶¡¡C
©³¤U¤¶²Ð°}¦C¡B°O¿ý¡B¶°¦X¡BÀɮ׳o¥|ºØµ²ºc«¬ºA¡A¦Ü©óÃþ§O(class)¤ÎÃþ§O°Ñ¦Ò(class
reference)³o¨âºØµ²ºc«¬ºA¡A¦bObject Pascal Language Guideªº²Ä9³¹¤¤¦³¸Ô²Óªº°Q½×¡C
°}¦C«¬ºA(array types)
¦b¶}©l¤¶²Ð°}¦C«¬ºA¤§«e¡AÅý§ÚÌ¥ý¬Ý¤@¨Ç«Å§iªº½d¨Ò:
type
Secs=array[0..59] of integer ;
Mins=array[0..59] of Secs ;
InSeat=array['A'..'Z'] of boolean ;
MyRect=array[1..2,1..2] of integer ;
Poly=packed array[60,1..2] of integer ;
°}¦C¾Ö¦³©T©w¼Æ¥Øªº«ü©w«¬ºA¡A¥H«O¯d¦rarray¨Ó«Å§i¡A«á±¥Î¤¤¬A¸¹¤º§t¯Á¤Þªº½d³ò¡A±µµÛ¥Î«O¯d¦rof¨Ó«ü©w°}¦C¤¸¯Àªº«¬ºA(component
type)¡C°}¦Cªººû«×(dimension)¨Ã¨S¦³¨î¡A¥B©Ò¦³ªº§Ç¼Æ«¬ºA³£¥i¥H®³¨Ó³]©w¯Á¤Þ½d³ò¡C
°}¦C¥»¨¤]¥i¥H·í¦¨¬O¤@ºØ¤¸¯À¡A©Ò¥H¥i¥H¦pMins³o¼Ë«Å§i¡C¦s¨ú³oºØ¦h¼h°}¦Cªº¤è¦¡¡A§ÚÌÁÙ·|¦b¤U¤@³¹´£¨ì¡C
°O¿ý«¬ºA(record types)
¦b°}¦C¤¤ÁöµM¦³¦hÓ¤¸¯À¡A¦ý¨C¤@Ó¤¸¯Àªº«¬ºA³£¬O¬Û¦Pªº¡CYn¦b¦P¤@Óªºµ²ºc¤U¦³¦hºØ«¬ºAªº¤¸¯À¦s¦b¡A´N¥²»Ý¨Ï¥Î°O¿ý«¬ºA¡C
°O¿ý«¬ºA¥Î«O¯d¦rrecord¨Ó«Å§i¡A½d¨Ò¦p¤U:
type
Employ=record
Name : string ;
Marry : boolean ;
Salary : currency ;
end ;
Car=record
year:1900..2100 ;
case accident:boolean of
false: (loss:currency; Damage:boolean) ;
true: (hodometer:double; insure:curreny) ;
end ;
end ;
¤W±«Å§i¤F¨âÓ°O¿ý«¬ºAEmploy©MCar¡A¤GªÌ³Ì¤jªº¤£¦P¦b©ócar¤¤¦h¤F¤@ÓÅÜ°ÊÄæ¦ì(variant)¡Acase¥Î¨Ó°Ï¤À¤£¦Pªº¼ÐÅÒÄæ¦ìÃѧO¦r(tag
field identifier)©Ò¥NªíªºÄæ¦ì¡A³o¨ÇÄæ¦ì¥i¯à·|¥Î¨ì¦@¦P¤@¶ô°O¾ÐÅé¡A¦b°õ¦æ®Éµ{¦¡·|¨Ì·Ó¼ÐÅÒÄæ¦ìªºÈ¨Ó¨M©wn¦p¦ó¨ú¥Î³o¤@Ó°O¿ýªº¤º®e¡C
¶°¦X«¬ºA(set types)
¶°¦X¬O§Ç¼Æ«¬ºAªº¤¸¯À©Ò²Õ¦X¦Ó¦¨¡A¥B¦b¤@Ó¶°¦X¤§¤¤ªº¤¸¯À«¬ºA¥²¶·¬Û¦P¡C«O¯d¦rset¥Î¨Ó«Å§i¶°¦X«¬ºA¡A¦p¤U¨Ò:
type
Week=(Sun, Mon, Tue, Wed, Thu, Fri, Sat) ;
Grade=set of 'A'..'E' ;
Today=set of Week ;
¶°¦Xªº½d³ò¤¤¤£¥i¥H¶W¹L256Ó¤¸¯À¡A¥B§Ç¼Æªº¼ÆÈ¥²¶·¤¶©ó0..255¤§¶¡¡C¤@Ó¤£¥]§t¥ô¦ó¼ÆȪº¶°¦X¡AºÙ¤§¬°ªÅ¶°¦X¡C
Ãö©ó¶°¦Xªº¹Bºâ¡A§Ú̦b³oùؼȤ£°Q½×¡C
Àɮ׫¬ºA(file types)
Àɮ׫¬ºA¨Ï¥Î«O¯d¦rfile«Å§i¡C¥i¥H¦b«á±±µµÛ¤@ºØ¤¸¯À«¬ºA(Àɮ׫¬ºA°£¥~)¨Ó«ü©w³Ì¤pªº¦s¨ú³æ¦ì¡C
type
f1 : file ;
f2 : file of char ;
f3 : file of double ;
f4 : textfile ;
¤å¦rÀÉ(textfile)¬O¤@ºØ¯S®íªºÀɮ׫¬ºA¡A·|¦Û°Ê³B²z³¡¥÷±±¨î¦r¤¸(´«¦æ¦r¤¸¡BÀÉ®×µ²§À)¡CÀɮ׫¬ºA¯A¤Î¨ìÀɮרt²Îªº¹B§@¡A³o¤@³¡¥÷¥i¥H°Ñ¦ÒObject
Pascal Language Guideªº²Ä13³¹, ùØÀY¦³§ó²`¤Jªº»¡©ú¡C
«ü¼Ð(pointer types)
«ü¼Ð¨Æ¹ê¤W¥u¬O¤@²Õ¼Æ¦r¡A°O¿ýµÛ¯u¥¿¦s©ñ¸ê®Æªº¦ì§}¡C¤@¯ëºÙ³oºØ°O¿ý¤è¦¡¬°"«ü¦V"¡A©Ò¥H§Ú̺D¥Î
"«ü¦Vxxxxªº«ü¼Ð" ¨Ó»¡©ú«ü¼Ð¤¤°O¿ýªº¦ì§}¥Nªíªº«¬ºA¡C
«ü¼Ð«¬ºA¥Dn¬O¹B¥Î¦b°ÊºAÅܼÆ(dynamic variable)¤¤¡A©Ò¿×ªº°ÊºAÅܼƦbµ{¦¡°õ¦æ¤¤¤~¨ú±o¤@¶ô°O¾ÐÅé¨Ó¨Ï¥Î¡A·í¤£¦A»Ýn³o¶ô°O¾ÐÅé¨ÓÀx¦s¸ê®Æ®É¡A«h±N³o¤@¶ô°O¾ÐÅéÂkÁÙµ¹¨t²Î¡C
Delphi¨Æ¥ý©w¸q¤F¨âºØ«ü¼Ð«¬ºA: pointer©Mpchar¡A¦¹¥~¤]¥i¥H«Å§i¦Ûqªº«ü¼Ð«¬ºA¡CÅý§ÚÌ¥ý¬Ý¤U±³o¤@¬qµ{¦¡«Å§iªº¤ù¬q:
type
WordP=^word ; // ¥Îword
«¬ºA§@¬°°ò©³«¬ºA(base type)
Link=^MyObject ; // ¦Ûq°O¿ý«¬ºA MyObject °µ¬°°ò©³«¬ºA
MyObject=record
data : longint ;
Next : Link ;
end ;
¦V¤Wªº½bÀY(^¡AASCII 94)¥Nªí³o¬O¤@Ó«ü¼Ð«¬ºA¡A«á±ºò±µµÛ°ò©³«¬ºA(base
type)¡A¤]´N¬O¨M©w¥¦©Ò«ü¦Vªº¨º¤@¶ô°O¾ÐÅé¬O¥Î¨º¤@ºØ«¬ºA¨ÓÀx¦s¸ê®Æªº¡C
¤@Ó«ü¼Ð¦b¨ú¥X¥¦©Ò«ü¦Vªº¸ê®Æ«e¡A¥²»Ý¥ý¨M©w©Ò«ü¦Vªº¬O¤°»ò«¬ºA¡Cpointer©M¨ä¥¦ªº«ü¼Ð«¬ºA¦³¤@Ó¤£¦P¡A¥¦¬O¤@Ó¤£«ü¦V¥ô¦ó¯S©w«¬ºAªº«ü¼Ð¡A©Ò¥H«Å§i¦¨pointer«¬ºAªºÅܼƤ£¯àª½±µ¨Ï¥Î«ü¼Ð²Å¸¹(^)¨ú¥X¥¦«ü¦Vªº¤º®e¡C¤£¹Lpointer©M¨ä¥¦ªº«ü¼Ð«¬ºA¬Û®e¡A¤]´N¬O»¡¥i¥H¥ý°µ«¬ºAÂà´«(typecast)¡A¦A¦s¨ú©Ò«ü¦Vªº¸ê®Æ¡C
pchar¦bsystem³æ¤¸¤¤«Å§i¦p¤U
type
PAnsiChar=^AnsiChar ;
PWideChar=^WideChar ;
Pchar=PAnsiChar ;
¹sµ²§À¦r¦ê¬Opchar³QÀ³¥Î³Ì¦hªº«¬¦¡¡A¦bObject Pascal Language Guideªº²Ä15³¹¬O¤@½g§¹¾ãªº³¹¸`°Q½×¹sµ²§À¦r¦ê¡A¦b³oùØ´N¤£¦h§@¤¶²Ð¤F¡C
³Ì«án´£¨ì¤@Ó«O¯d¦rnil¡Cnil¥Nªí¤@Ó«ü¼Ð«¬ºA¨S¦³«ü¦V¥ô¦ó¦a¤è¡A¥i¾A¥Î©ó¥ô¦ó¤@ºØ«ü¼Ð«¬ºA¡C
µ{§Ç«¬ºA(procedural types)
µ{§Ç«¬ºA¬O§âµ{§Ç(precodure)©M¨ç¼Æ(function)µø¬°¤@ºØ«¬ºA¡A¥i¥H«Å§i¦¨ÅܼơA¬Æ¦Ü¬O·í¦¨°Ñ¼Æ¨Ó¶Ç»¼¡C
°£¤F¬Ù²¤ÃѧO¦r(µ{§Ç¦WºÙ)¥~¡Aµ{§Ç«¬ºAªº«Å§i©M¤@¯ëµ{§Ç(¨ç¼Æ)ªº«Å§i¤è¦¡´X¥G¬O¤@¼Ò¤@¼Ëªº¡CÅý§Ú̬ݬݩ³¤Uªº½d¨Ò:
type
Tprocedure=procedure ;
TMyCallBack=procedure(h:word) ;
TMyFunc=procedure(a,b:integer;c:float) ; stdcall ;
TMouseEvent = procedure (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y:
Integer) of object;
¦]¬°¤@Óµ{§Ç(©Î¨ç¼Æ)¦b©I¥s®É¡A·|¦³°Ñ¼Æ¶Ç»¼ªº°ÝÃD¡A¤×¨ä¬O©M«DDelphiµ{¦¡°µ³sµ²®É¡A§ó¬Onª`·N°Ñ¼Æªº¶Ç»¼ªº¤è¦¡¡A§_«h´N±o¤£¨ì¥¿½Tªºµ²ªG¤F¡C¦]¬°¥Ø«e¦UºØ½sĶ¾¹¨Ï¥Îªº°Ñ¼Æ¶Ç»¼¤è¦¡¤£ºÉ¬Û¦P¡A©Ò¥H¦b«Å§iµ{§ÇÅܼƮɡA§Ṳ́]¥i¥H«ü©w©I¥sºD¨Ò¨Ó¨M©w°Ñ¼Æªº¶Ç»¼¤è¦¡¡A´N¹³¤W¨Ò¤¤TMyFuncªº«Å§i«ü©w¥Îstdcallªº©I¥sºD¨Ò¡C¥i¥H«ü©wªº©I¥sºD¨Ò¦@¦³¥|ºØ:
register¡Bcdecl¡Bpascal©Mstdcall¡C·í½sĶ¿ï¶µ³]©w³Ì¨Î¤Æ®É¡A¹w³]ªº©I¥sºD¨Ò¬°register¡AY¤£³]©w³Ì¨Î¤Æ«h¤º©w¬°pascal¡C
¤W¨Ò¤¤¡ATMouseEvent¦bprocedure«á¦h¤F¨âÓ«O¯d¦rof obiect¡A§Ú̺ٳoºØ«¬¦¡ªºµ{§Ç«¬ºA¬°¤èªk«ü¼Ð(method
pointers)¡A¤èªk«ü¼Ð¥i¥H°Ñ¦Òª«¥ó(object)¤¤ªºµ{§Ç©Î¨ç¼Æ¡AY¨S¦³¥[¤Wof
object§ÚÌ«hºÙ¬°¥þ°ìµ{§Ç«ü¼Ð(global procedure pointers)¡A¥Î¨Ó°Ñ¦Ò¥þ°ìªºµ{§Ç©Î¨ç¼Æ¡C¤èªk«ü¼Ð©M¥þ°ìµ{§Ç«ü¼Ðªº°O¿ý¤è¦¡¤£¦P(¤èªk«ü¼Ð¦h¤F¤@Ó«ü¼Ð°O¿ýª«¥ó)¡A¤GªÌ¤£¥i²V¥Î¡C
¨Æ¹ê¤W¡Aµ{§Ç«¬ºA¤]¬O¤@ºØ«ü¼Ð¡A¥Î¨Ó«ü¦V¤@Óµ{§Ç(¨ç¼Æ)ªº¦ì§}¡C¦]¦¹¥ô¦óµ{§Ç«¬ºA«Å§i¥X¨ÓªºÅܼƳ£¥i«ü©w¬°nil¡C
n«ü©w¤@Ó¥þ°ìµ{§Ç(¨ç¼Æ)¨ì¥Îµ{§Ç«¬ºA©Ò«Å§iªºÅܼƤ¤¡A¥þ°ìµ{§Ç(¨ç¼Æ)¥²¶·³]¬°»·µ{©I¥s(far
call)¡A¥i¥H¦b¥þ°ìµ{§Çªº«á±¥[¤W«O¯d¦rfar¡A©Î¦b{$F+}ª¬ºA¤U½sĶ¡C¥t¥~¦³´XºØµ{§Ç©M¨ç¼Æ¤£¯àª½±µ«ü©wµ¹µ{§ÇÅܼơA¦p:
¼Ð·Çµ{§Ç©M¨ç¼Æ¡B±_ª¬µ{§Ç©M¨ç¼Æ¡A¥H¤Îinlineµ{§Ç©M¨ç¼Æ¡C
ÅÜ°Ê«¬ºA(variant types)
¤§«e©Ò¤¶²Ðªº¦UºØ«¬ºA¡A¤@¥¹«Å§i«á¡A¥¦ªº«¬ºA´N©T©w¤£ÅÜ¡A¥u¦³¦b¹Bºâ®É¡A¥i¥H§Q¥ÎÂ૬(typecast)©Î¬O¨ç¼ÆÂà´«¤~¯à©M¤£¦P«¬ºAªº¼ÆÈ°µ¹Bºâ¡C²{¦b§ÚÌn¤¶²Ðªº³oºØ«¬ºA¡A¥i¥H¦Û°Ê¦b¦UºØ«¬ºA¤¤Âà´«¡A©Ò¥HºÙ¬°ÅÜ°Ê«¬ºA¡C
§ÚÌ¥ÎÃѧO¦rvariant¨Ó©w¸qÅÜ°Ê«¬ºA¡A¦P¼Ëªº¡AÁÙ¬O¥Î¨Ò¤l¨Ó»¡©ú¤°»ò¬OÅÜ°Ê«¬ºA¡C
var
v1,v2,v3 : variant ;
begin
v1:=100 ; // ¾ã¼ÆÈ
v2:='3.1416' ; // ¦r¦ê
v3:=v1*v1*v2 ; // ¦r¦ê·|¦Û°ÊÂন¹ê¼Æ«¬ºA«á¹Bºâ¡Aµ²ªG¬°¹ê¼Æ
v3:=varArrayCreate([0,2],varVariant) ; // ¤@ºûÅÜ°Ê°}¦C
v3[0]:=false ; // ¥¬ªL«¬ºA
V3[1]:='test' ; // ¦r¦ê«¬ºA
v3[2]:=varArrayOf([101,102,103]) ; // °}¦C«¬ºA
v1:=v3[2][0] // 101
v2:=v3[2][1] // 102
end ;
¥Ñ«e±³oÓ¨Ò¤l«Ü©úÅã´N¥i¥H¬Ý¥XÅÜ°Ê«¬ºAªº¯S©Ê¡A¥i¥H«ü©w¦¨¤£¦Pªº«¬ºA¡A¨Ã¦Û°ÊÂà´«¦¨¹Bºâ©Ò»Ýnªº¹Bºâ¡A·íµM¡A¦pªG¬OµLªkÂà´«ªº«¬ºA¡AÁÙ¬O·|²£¥Í¿ù»~°T®§¡C¨Ò¦p§â
'abc' ®³¨Ó°µ¥[ªk³o¤@Ãþªº¹Bºâ¤´µM¬O¤£¤¹³\ªº¡C
ÅÜ°Ê«¬ºA¦bDelphi 32¦ì¤¸ª©«á¤~¦³´£¨Ñ¡A¨ä¯S©Ê¾ã²z¦p¤U:
O ¤@ÓÅÜ°Ê«¬ºAÅܼƨϥÎ16Ӧ줸²Õ¡A¥]§t¤@Ӧ줸²Õªº«¬ºA½s¸¹(Type
Code)¡C¥i¥H¨Ï¥Î¼Ð·Ç¨ç¼ÆVarType¨ú¦^ÅÜ°Ê«¬ºAªº«¬ºA½s¸¹¡C
O ÅÜ°Ê«¬ºA¥i¥H¬O¤U¦C´XºØ«¬ºA:
¾ã¼Æ¡B¹ê¼Æ¡B¦r¦ê¡B¥¬ªL¡B®É¶¡¡B°}¦C¡A¥H¤ÎOLE¦Û°Êª«¥ó(Automation
Objects)¡C¤£¹L°}¦Cªº¨Ï¥Î¤£¯àª½±µ«ü©w¤@Ó¤w«Å§iªº°}¦C¡A¥²¶·¨Ï¥Î¨t²Î´£¨Ñªº¨ç¼Æ¨Ó²£¥Í¡C
O ¦³¨âÓ¯S©wªºÅÜ°Ê«¬ºA¼ÆÈ¡Cunassigned¥Nªí¤@Ó©|¥¼«ü©w¼ÆȪºÅÜ°Ê«¬ºAÅܼơCnull«hªí¥Ü¤@Ó¥¼ª¾©Î¬O¨S¦³¸ê®ÆªºÅܼơC
O
ÅÜ°Ê«¬ºAÅܼƥi¥H©M¨ä¥Lªº«¬ºA¡A¦p¾ã¼Æ¡B¹ê¼Æ¡B¦r¦ê¡B¥¬ªL¡B®É¶¡µ¥ª½±µ¹Bºâ¡AÅÜ°Ê«¬ºA·|¦Û°Ê²£¥Í¥²¶·ªºÂà´«¡C
O ·íÅÜ°Ê«¬ºAÅܼƥ]§t¤@ÓOLE¦Û°Êª«¥ó®É¡A³oÓÅܼƥi¥H¨Ï¥Î¨äÄÝ©Ê(properties)¤Î¤èªk(methods)¡C²£¥ÍOLE¦Û°Êª«¥óªº¤èªk¥i¥H¨Ï¥ÎCreateOleObject¨Ó¹F¦¨¡C
O ·í¤@ÓÅÜ°Ê«¬ºAÅܼƲ£¥Í®É¡A¤@©w¬O³]¦¨unassigned¡C
O
¨Ï¥ÎÅÜ°Ê«¬ºA¡A¦]¬°»Ýn¦³¸û¦hªºÂà´«¡A©Ò¥H·|¨Ï¥Î¸û¦hªº°O¾ÐÅé¤Î¹Bºâ®É¶¡¡C
Ãö©óÅÜ°Ê«¬ºA¡ADelphi´£¨Ñ¤F¤@¨t¦Cªº¬ÛÃö¨ç¼Æ¡A¦b¦¹§ÚÌ¥u¬O¤¶²ÐÅÜ°Ê«¬ºAªº¯S©Ê¡A¸Ô²Óªº¹B¥Î¤Î¬ÛÃö¨ç¼Æ»¡©ú¡A½Ð°Ñ¦Ò¨Ï¥Î¤â¥U©Î½u¤W»¡©ú(On-Line
Help)¡C
«¬ºA¶¡ªºÃöÁp
¦bµ{¦¡¤¤»Ýn¬O¬Û¦P(identical)©Î¬Û®e(compatible)«¬ºAªºÅܼơA¤~¥i¥H¤¬¬Û«ü©w¡B¹Bºâ©Î·í¦¨°Ñ¼Æ¶Ç»¼¡C
¥u¦³·í¦¨°Ñ¼Æ¶Ç»¼®É¡A¤~n¨D¤@©wn¬Û¦Pªº«¬ºA¡A«ü©w©Î¹Bºâ®É¥un«¬ºA¬Û®e§Y¥i¡C
«¬ºA¬Û¦P
¥²¶·¬O¥Î¬Û¦Pªº«¬ºAÃѧO¦r«Å§i¡A©Î¬O³Q«Å§i¦¨¬Û¦P«¬ºA¡A§Ṳ́~ºÙ¬°¬O«¬ºA¬Û¦P¡C¤U±¬O¤@¨Ç¨Ò¤l:
type
T1=word ;
T2=word ;
T3=T2 ; // T1, T2, T3¤GÓ«¬ºA¬O¬Û¦Pªº¡C
T5=set of 'A'..'E' ;
T6=set of 'A'..'E' ; // T5©MT6¬Û®e¡A¦ý¬O¤£¬Û¦P¡C
var
V1, V2 : T5 ; // V1©MV2«¬ºA¬Û¦P
V3 : T6 ; // V1©MV3«¬ºA¤£¬Û¦P
«¬ºA¬Û®e
¥²¶·¬O¬Û®eªº«¬ºA¤~¥i¥H©ñ¦b¤@°_¹Bºâ©Î«ü©w¼ÆÈ¡C¦b«ü©w¤@Ó¼Æȵ¹ÅܼƮɡA°£¤F¥²¶·¬O¬Û®eªº«¬ºA¥~¡AÁÙn²Å¦X«ü©w¬Û®e(assignment
compatibility)ªº³W«h¡C©³¤U¤À§O¦C¥X¬Û®eªº«¬ºA©M«ü©w¬Û®eªº±ø¥ó:
¬Û®eªº«¬ºA
O ¤GÓ¬Û¦Pªº«¬ºA¡C
O ¤GÓ¾ã¼Æ«¬ºA¡C
O ¤GÓ¹ê¼Æ«¬ºA¡C
O ¤GÓ¬Û¦P¥D«¬ºAªº¤l½d³ò«¬ºA¡C
O ¤GÓ¦³¬Û¦P¼Æ¥Ø¤¸¯ÀªºÀ£ÁY¦r¦ê«¬ºA¡C
O ¤GӨ㦳¬Û¦P°ò¦«¬ºAªº¶°¦X«¬ºA¡C
O ¤GÓ«ü¦V¬Û¦P«¬ºAªº«ü¼Ð¡C(¥u¦³³]©w{$T+}¤~¦¨¥ß)
O ¤GӶǦ^È«¬ºA¬Û¦P¥B¨C¤@Ó¹ïÀ³°Ñ¼Æªº«¬ºA³£¬Û¦Pªºµ{§Ç«¬ºA¡C
O pointer«¬ºA©M¥ô¦ó«ü¼Ð«¬ºA¡C
O ¤l½d³ò«¬ºA©M¥¦ªº¥D«¬ºA¡C
O Ãþ§O«¬ºA(Ãþ§O°Ñ¦Ò«¬ºA)©M¥¦ªº«á¥N¡C
O ¤@Ó¦r¦ê«¬ºA¡A¥t¤@Ó¬O¦r¦ê©Î¬OÀ£ÁY¦r¦ê©Î¦r¤¸(char)«¬ºA¡C
O pchar©M¥t¤@Ó¥H¹s¬°°ò¦ªº¦r¤¸°}¦C¡C(¥u¦³³]©w{$X+}¤~¦¨¥ß)
«ü©w¬Û®e
«ü©w±Ôz¡A¹³¬Ov1:=v2¡A¥²¶·²Å¦X¤U¦C¨ä¤¤¤@¶µ±ø¥ó¤~¯à¦¨¥ß¡A§_«h¦b½sĶªº¹Lµ{¤¤¡A·|²£¥Í¿ù»~¡C
O v1©Mv2¬O¬Û®eªº«¬ºA¡A¥Bv2ªº¼ÆȦbv1©Ò¤¹³\ªº½d³ò¤º¡C
O v1©Mv2³£¤£¬O¥B¤£¥]§tÀɮ׫¬ºAªºÅܼơC
O v1¬O¹ê¼ÆÅܼơAv2¬O¾ã¼ÆÅܼơC
Ãö©ó«¬ºAªº³¡¥÷´N¤¶²Ð¨ì³oùØ¡AYÁÙ»Ýn§ó¸ÔºÉªº²Ó¸`¡A½Ð°Ñ¦ÒDelphiªº¨Ï¥Î¤â¥U©Î½u¤W»¡©ú(On-Line
Help)¡A¥i±o¨ì¬ÛÃöªº¸ê°T¡C
|