久久精品精选,精品九九视频,www久久只有这里有精品,亚洲熟女乱色综合一区
    分享

    Lazarus中objfpc編譯模式與delphi編譯模式的不同

     quasiceo 2012-11-30

    Lazarus中objfpc編譯模式與delphi編譯模式的不同

    (2011-03-28 23:33:22)

    今天碰到了Lazarus編譯模式的問題,以前一直認為Lazarus和delphi語法之類的都是一樣的, 今天在事實面前證明,不一樣!

    編譯模式的聲明是在文件開頭,unit 下面

    {$mode delphi }  或者 {$mode objfpc }

     

    Lazarus官網說明:

    This mode is selected by the $MODE DELPHI switch. It tries to emulate, as closely as possible, the behavior of Delphi 4 or higher. On the command line, this mode is selected by the -Mdelpih switch.//http://www./blog 

    1. You cannot use the address operator to assign procedural variables.
    2. A forward declaration does not have to be repeated exactly the same by the implementation of a function/procedure. In particular, you can omit the parameters when implementing the function or procedure.
    3. Ansistrings are default, this means that $MODE DELPHI implies an implicit {$H ON}.
    4. Overloading of functions is not allowed. //http://www./blog 
    5. Nested comments are not allowed.
    6. The Objpas unit is loaded right after the system unit. One of the consequences of this is that the type Integer is redefined as Longint.
    7. Parameters in class methods can have the same names as class properties (although it is bad programming practice).//http://www./blog 

    This mode is selected by the $MODE OBJFPC switch. On the command line, this mode is selected by the -Mobjfpc switch.

    1. You must use the address operator to assign procedural variables.
    2. A forward declaration must be repeated exactly the same by the implementation of a function/procedure. In particular, you cannot omit the parameters when implementing the function or procedure, and the calling convention must be repeated as well.
    3. Overloading of functions is allowed.
    4. Nested comments are allowed.
    5. The Objpas unit is loaded right after the system unit. One of the consequences of this is that the type Integer is redefined as Longint.
    6. You can use the cvar type.
    7. PChars are converted to strings automatically.
    8. Parameters in class methods cannot have the same names as class properties.
    9. Strings are shortstrings by default. You can use the -Sh command line switch or the {$H+} switch to change this.

    Minun幫忙的解釋:

    //http://www./blog  

    D.3 Delphi mode

    1、你不能在函數指針或者運算符上使用地址符號
    2、事先的申明可以省略參數
    3、AnsiString是默認的,
    4、同名函數是不允許的
    5、備注嵌套是不允許的
    6、objpas加載在system之后,明顯的區別在于integer是longint
    7、類方法的參數可以與類屬性同名

    D.4 OBJFPC mode

    1、你必須在函數指針或者運算符上加上地址符號
    2、事先的生命必須完全和后面的實現相符合,相反,你可以在實現中省略參數
    3、同名函數是允許的//http://www./blog 
    4、備注嵌套是允許的//http://www./blog 
    5、objpas加載在system之后,(和delphi一樣)
    6、你可以使用cvar類型
    7、PChars被自動當作strings處理
    8、類方法的參數不能與類屬性同名
    9、String默認是ShortString,

    一個例子:

    記錄類型

    ta=record
        a:integer;
      end ;
      Pta=^ta;     

    =====================

     

     

    第一種寫法:

    var
      s:Pta;
    begin
       s:=new(pta);
       s.a:=5;
    end;       

     

    第二種寫法:

    var
      s:Pta;
    begin
       s:=new(pta);
       s^.a:=5;
    end;    

    //http://www./blog   

    第一種第二種寫法在Delphi模式下都能通過,而在objfpc下只能通過第二種。

      本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發布,不代表本站觀點。請注意甄別內容中的聯系方式、誘導購買等信息,謹防詐騙。如發現有害或侵權內容,請點擊一鍵舉報。
      轉藏 分享 獻花(0

      0條評論

      發表

      請遵守用戶 評論公約

      類似文章 更多

      主站蜘蛛池模板: 欧洲精品色在线观看| 免费网站看V片在线毛| 男女18禁啪啪无遮挡激烈| 蜜臀AV在线播放一区二区三区| 中文字幕日韩精品国产| 国产99在线 | 免费| 欧美丰满熟妇BBB久久久| 宅男噜噜噜66在线观看| 无码人妻精品一区二区三区蜜桃| 精品一区二区亚洲国产| 亚洲AV高清一区二区三区尤物| 福利视频一区二区在线| 亚洲AV无码成H人动漫无遮挡| 亚洲成人av综合一区| 高清不卡一区二区三区| 国产成人亚洲综合图区| 无码日韩精品一区二区人妻| 久久被窝亚洲精品爽爽爽| 国产草草影院ccyycom| 夜色福利站WWW国产在线视频| 亚洲精品宾馆在线精品酒店| 1000部拍拍拍18勿入免费视频 | 中文字幕久久国产精品| 高清无码一区二区在线观看吞精 | 国产精品无码a∨麻豆| 日产精品99久久久久久| 高清无码爆乳潮喷在线观看| 国产精品V欧美精品V日韩精品 | 少妇xxxxx性开放| 精品无码一区二区三区电影| 国产精品亚洲二区在线播放| 久久综合九色欧美综合狠狠 | 天下第二社区在线视频| 四川丰满少妇无套内谢| 午夜无码区在线观看亚洲| 国产精品国产三级国快看| 欧美福利电影A在线播放| 熟妇人妻无码中文字幕| 午夜免费国产体验区免费的| 国产精成人品日日拍夜夜 | 亚洲av永久无码精品网站|