ÊÖ»úÕ¾
ÍøÍ¨·ÖÕ¾
µçÐÅÖ÷Õ¾
ÃÜ¡¡Âë:
Óû§Ãû£º
µ±Ç°Î»Öà : Ö÷Ò³>³ÌÐòÉè¼Æ>delphi>Áбí

Éý¼¶µ½Delphi 6 - ¼æÈÝÐÔÎÊÌâÖ®¶þ

À´Ô´£º»¥ÁªÍø ×÷ÕߣºÎ÷²¿ÊýÂë ʱ¼ä£º2008-04-10
Î÷²¿ÊýÂë-È«¹úÐéÄâÖ÷»ú10Ç¿£¡40ÓàÏîÐéÄâÖ÷»ú¹ÜÀí¹¦ÄÜ,È«¹úÁìÏÈ!Ë«Ïß¶àÏßÐéÄâÖ÷»úÄϱ±·ÃÎʳ©Í¨ÎÞ×è!Ãâ·ÑÔùËÍÆóÒµÓʾÖ,.CNÓòÃû,×ÔÖú½¨Õ¾480ÔªÆð,Ãâ·ÑÊÔÓÃ7Ìì,ÂúÒâÔÙ¸¶¿î! P4Ö÷»ú×âÓÃ799Ôª/ÔÂ.Ô¸¶Ãâѹ½ð!
Code that relies heavily on the typed const quirk (such as the ActiveX control wrapper generator) can insert a {$WRITEABLECONST ON} directive in the source file as a quick fix. This practice is forbidden in the RTL, VCL, CLX, and DB source code and discouraged in the IDE sources, but acceptable for fringe units such as ActiveX control wrappers.

In general, you should note that the phrase "writeable constant" is an oxymoron. Prior versions of Delphi allowed them by default to maintain compatibility with an older 16-bit compiler, which is no longer important for most Delphi developers. Use good programming practice; avoid writeable constants.

Èý£® CardinalÀàÐ͵ĸºÊýÖµ

¹ýÈ¥£¬Delphi´¦ÀíCardinalÀàÐ͵ĸºÊýֵʱʹÓÃ32λµÄ»úÖÆ£¬ÕâÑùʹµÃ½á¹ûΪһЩÁãÍ·µÄÖµ£¨CardinalÀàÐÍÔÊÐíµÄ×î´óµÄÖµÓ뵱ǰֵµÄ²î¼ÓÒ»£©¡£ÒÔÏÂΪÀý×Ó£º

var

c: Cardinal;

i: Int64;

begin

c := 4294967294;

i := -c;

WriteLn(i);

end;

ÔÚÒÔÍù°æ±¾µÄDelphiÖУ¬IµÄÖµÓ¦µ±ÊÇ2¡£µ«ÊÇÕâÖÖÇé¿öÏÂÕâ¸öÖµÃ÷ÏÔ²»¶Ô¡£Delphi 6ÖУ¬CardinalÀàÐÍÊÇÏÈת»¯Îª64λµÄÓзûºÅÀàÐÍ£¬È»ºóÈ¡Æä¸ºÊýÖµ£¬ËùÒÔ×îÖÕ½á¹ûIµÄֵΪ-4294967294¡£

¿ÉÄÜÓÐÒѾ­´æÔڵĴúÂëÒÀÀµÓÚÔ­ÏÈ´íÎóµÄCardinal¸ºÊýÖµµÄʵÏÖ·½·¨¡£¶ÁÕßÓ¦µ±¶Ô

ÎÄÕÂÕûÀí£ºÎ÷²¿ÊýÂë--רҵÌṩÓòÃû×¢²á¡¢ÐéÄâÖ÷»ú·þÎñ
http://www.west263.com
ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúÒª×ªÔØ±¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!