delphiÖеļ¸¸ö·ûºÅ@¡¢^¡¢$
@·ûºÅ·µ»ØÒ»¸ö±äÁ¿µÄµØÖ·
Àý£º
var
f:string;
p:^string; //ÉùÃ÷Ò»¸ö×Ö·û´®ÀàÐ͵ÄÖ¸Õë
begin
f ='demo';
p = @f;
showmessage(p^);//ÏÔʾ½á¹ûΪ‘demo’
end;
^·ûºÅÔÚdelphiÖдú±íÖ¸ÕëµÄÒâ˼.
$ÊDZàÒëÖ¸Á¾ßÌåÓ÷¨¼ûÏÂÎÄ£®
Delphi±àÒëÖ¸Áî˵Ã÷
Delphi¿ìËÙ¸ßЧµÄ±àÒëÆ÷Ö÷ÒªÀ´×ÔObject PASCALµÄÑϽ÷£¬Ê¹ÓÃDelphiËæʱ¶¼ÔÚÓë±àÒëÆ÷½»Á÷£¬´ó²¿·ÖÇé¿öϲ»ÐèÒª¸ÉÉæ±àÒëÆ÷µÄÔËÐУ¬µ«ÊÇÓÐʱҲÐèÒª¶Ô±àÒëÆ÷½øÐбØÒªµÄÉèÖá£
A.1 ʹÓñàÒëÉèÖöԻ°¿ò
±àÒëÆ÷µÄ±àÒëÖ¸ÁîÊÇÓÃÓÚÖ¸¶¨±àÒëÆ÷¶ÔÏîÄ¿±àÒë¹ý³ÌµÄ¶¯×÷ºÍÐÐΪ¡£¿ÉÒÔͨ¹ý[Project]->[Options]->[Complier]Ñ¡ÏîÒ³½øÐÐÉèÖ㬾ø´ó²¿·ÖµÄ±àÒë»·¾³¶¼¿ÉÒÔͨ¹ýÕâÒ»¶Ô»°¿ò½øÐе÷Õû£¬Ëû°üº¬Á˶ԴúÂë¡¢Óï·¨¡¢µ÷ÊÔÐÅÏ¢µÈµÄÉèÖá£
1.´úÂëÉèÖÃ(Code Generation)
Optimization: ´úÂëÓÅ»¯¿ª¹Ø
Aligned record fields: ×Ö¶ÔÆëÊý¾Ý¡£Õâ¸ö±àÒëÖ¸ÁîÄܹ»ÔÚ±äÁ¿ºÍÀàÐÍ»¯³£Á¿µÄ×Ö½Ú¶ÔÆëºÍ×Ö¶ÔÆëÖ®¼ä½øÐÐÇл»£¬Æä×÷ÓÃÊÇÈ«¾ÖµÄ¡£
Stack frames: Windows ¶ÑÕ»Ö¡¡£Æä×÷ÓÃÓòÊǾֲ¿µÄ£¬Ëûʹ±àÒëÆ÷³ÉΪԶ¶Ë¹ý³ÌºÍº¯ÊýÉú³ÉÌض¨µÄ¿ªÍ·ºÍ½áβ´úÂë¡£Õâ¸öÖ¸ÁîÓÃÓÚWindows 3.0µÄʵģʽ£¬¶ÔËùÓÐDelphiÓ¦ÓóÌÐòËûÓ¦¸ÃÊǹرյġ£
Pentium-safe FDIV: Pentium°²È«FDIV¼ì²é¡£´ËÖ¸ÁîÄܹ»ÔÚPentium´¦ÀíÆ÷ÖÐÖ¸¶¨±àÒëÆ÷ÊÇ·ñ´´½¨Äܹ»¼ì²âºÍʹÓÃÓÐȱÏݵĸ¡µã³ý·¨Ö¸ÁîµÄ´úÂë¡£
2.ÔËÐÐÆÚ´íÎó(Runtime Errors)
Range Checking: ·¶Î§¼ì²é¡£Õâ¸öÖ¸ÁîµÄ×÷Ó÷¶Î§ÊǾֲ¿µÄ£¬ÓÃÓÚ¿ØÖÆ·¶Î§¼ìÑé´úÂëµÄÉú³É¡£
I/O Checking: I/O¼ì²é¡£Õâ¸öÖ¸ÁîµÄ×÷ÓÃÓòΪ¾Ö²¿£¬ÓÃÀ´Éú³É¶ÔÒ»¸öÎļþµÄÊäÈëºÍÊä³ö¹ý³ÌºÍµ÷Óýá¹û½øÐмì²éµÄ´úÂë¡£Ò»°ãÓ¦¸ÃʹÆ书ÄÜ´ò¿ª¡£
Overflow Checking: Òç³ö¼ì²é¡£Æä×÷ÓÃÊÇÉú³É¶ÔËãÊõÒç³ö¼ì²éµÄ´úÂë¡£
3.Óï·¨ÉèÖÃ(Syntax Optings)
Strict Var- strings: ¾²Ì¬±äÁ¿´®¿ª¹Ø¡£ÓÃÀ´¿ØÖƶÔÒÔ±äÁ¿²ÎÊýÐÎʽ´«µÝµÄ´®µÄÀàÐͼì²é¡£
Comlete Boolean Eval: ÍêÈ«²¼¶û±í´ïÁ¿Åж¨¡£ÓÃÓÚÖ´ÐÐÇ¿ÖƵÄÍêÕû±í´ïʽÅж¨¡£ÍêÈ«²¼¶ûÁ¿Åж¨£¬ÓпÉÄܵ¼ÖÂϵͳ±ÀÀ££¬ËùÒÔÒ»°ã²»Ê¹ÓÃËû¡
Ïà¹ØÎĵµ£º
Ä£°å·½·¨Ä£Ê½¶¨ÒåÁËÒ»¸öËã·¨¹Ç¼Ü£¬ÔÊÐí×ÓÀà¶ÔËã·¨µÄij¸ö»òijЩ²½Öè½øÐÐÖØд£¨override)¡£
1.CoffeineBeverageWithHook
{¡¶HeadFirstÉè¼Æģʽ¡·Ö®Ä£°å·½·¨Ä£Ê½ }
{ ±àÒ빤¾ß: Delphi7.0 }
{ E-Mail : xshlife@163.com }
unit uCoffeineBeverageWithHook;
interface
uses
SysUti ......
ʲôÊǶà̬£¬×ÖÃæÒâ˼¾ÍÊÇ“¶àÖÖÐÎ̬”£¬ÓöÔÏóÀ´½²¾ÍÊÇ×ÓÀà¼Ì³Ð»ùÀ࣬¶ø²»Í¬µÄ×ÓÀàÓÖ·Ö±ð¶Ô»ùÀà½øÐй¦ÄܵÄÀ©Õ¹¡£
¶à̬ÔÚObject PascalÖÐÊÇͨ¹ýÐé·½·¨ÊµÏֵģ¨Virtual Method£©,ÔÚObject PascalÖлùÀàµÄÐé·½·¨ÊÇ¿ÉÒÔ±»ÅÉÉúÀา¸Ç£¨Override£©µÄ ......
´ó¼Ò¶¼ÈÏΪ£¬CÓïÑÔÖ®ËùÒÔÇ¿´ó£¬ÒÔ¼°Æä×ÔÓÉÐÔ£¬ºÜ´ó²¿·ÖÌåÏÖÔÚÆäÁé»îµÄÖ¸ÕëÔËÓÃÉÏ¡£Òò´Ë£¬ËµÖ¸ÕëÊÇCÓïÑÔµÄÁé»ê£¬Ò»µã¶¼²»Îª¹ý¡£Í¬Ê±£¬ÕâÖÖ˵·¨Ò²ÈúܶàÈ˲úÉúÎó½â£¬ËƺõÖ»ÓÐCÓïÑÔµÄÖ¸Õë²ÅÄÜËãÖ¸Õë¡£Basic²»Ö§³ÖÖ¸Õ룬Ôڴ˲»ÂÛ¡£Æäʵ£¬PascalÓïÑÔ±¾ÉíÒ²ÊÇÖ§³ÖÖ¸ÕëµÄ¡£´Ó×î³õµÄPascal·¢Õ¹ÖÁ½ñµÄObject Pascal£¬¿ÉÒÔ˵ÔÚÖ¸ÕëÔËÓ ......
ÔÚDelphiÖÐʹÓÃRASʵÏÖ¶Ôϵͳ²¦ºÅµÄ¿ØÖÆ
ÔÚÆóÒµÓ¦ÓÃÖÐÓÐʱºòÏ£ÍûÄÜÔÚ³ÌÐòÖÐʵÏÖ¶Ô²¦ºÅÍøÂçµÄ¿ØÖÆ£¬ÒÔʵÏÖ×Ô¶¯²¦ºÅ¡¢×Ô¶¯¶Ï¿ªÍøÂç¡£ÔÚ³¢ÊÔÁ˶àÖÖ·½Ê½Ö®ºó£¬ÈÏΪRASÊÇÒ»ÖֱȽÏÎȶ¨µÄ·½Ê½¡£ÔÚgoogleÁËÍøÉÏһЩ×ÊÁϺó£¬ÏÖÕûÀíÈçÏ£º
Ò»¡¢Ê×ÏÈÐèÒªÓиöÕë¶ÔRASµÄÍ·Îļþ¶¨Ò壬Ras.pas´úÂëÈçÏÂ
{* Cop ......