• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            聚星亭

            吾笨笨且懶散兮 急須改之而奮進
            posts - 74, comments - 166, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

                   本文章將試著講述一些好的習慣,它或許可以幫助你更快更容易的找出問題的解決方案(原文: This article will try to explain some good practices, that will help you get going faster and easier find the solution when a problem occurs.)。

             

                   注冊時一定要檢查的返回值,至少在調試模式下配置腳本引擎的時候,一定要檢查返回值,(原文:Always check return values for registrationsWhen configuring the script engine you should always check the return values, at least in debug mode)。【當構建失敗時,幾乎所有的錯誤代碼都可以用一個像assert( r >= 0 )簡單的斷言來檢查返回值r(原文: All error codes are negative so a simple assert( r >= 0 ) where r is the returned value is sufficient to pinpoint where the configuration failed.)】。

                  

            如果一個函數在構建期間失敗了,則構建方法總是會失敗,并返回一個asINVALID_CONFIGURATION的錯誤碼。 (原文: If a function failed during the configuration, the Build method will always fail with a return code of asINVALID_CONFIGURATION.)。錯誤總是不可確定,除非你總是檢查所有函數調用的錯誤碼(原文:Unless you already verified the error codes for all the configuration calls, it will not be possible to determine what the error was)

            // assert檢查返回值 即簡單又不會打亂你的代碼

            r = engine->RegisterGlobalFunction("void func()", asFUNCTION(func), asCALL_CDECL);

            assert( r >= 0 );

            在注冊引擎的時候assert()可以被安全的使用,當有一個函數失敗時,引擎被設置為構建無效的內部狀態。(原文:

            assert() can safely be used with engine registrations, since the engine will set the internal state to invalid configuration if a function fails. )。當一個腳本被組建時即使在Release模式下也會失敗(原文: Even in release mode the failure is discovered when a script is built.)。

             

            使用消息回調來接收更詳細的錯誤信息(原文:Use the message callback to receive detailed error messages)。

             

            注冊函數的返回值,組建和編譯功能都只能告訴你什么出錯了而不是錯誤是什么(原文: The return code from the register functions, Build, and CompileFunction, can only tell you that something was wrong, not what it was.)。消息回調就是被用來確定問題之所在的(To help identify the exact problem the message callback should be used.)。腳本庫將發送消息 通過普通的文字來說明錯誤和警告的原因(原文: The script library will then send messages explaining the error or warning in clear text.)。

            關于消息回調的更多信息請參考Message callback(原文: See Message callback for more information on the message callback.)

             

             

                                                                                                                    ---------  besterChen

                                                                                                                     譯于 2010410星期六
            亚洲色大成网站www久久九 | 久久精品无码av| 国产精品午夜久久| 久久一区二区三区99| 久久人妻AV中文字幕| 国产91色综合久久免费分享| 久久se精品一区精品二区国产| 久久久久久久久久久| 久久免费线看线看| 久久精品国产乱子伦| 93精91精品国产综合久久香蕉 | 久久精品一区二区三区中文字幕| 欧美亚洲日本久久精品| 精品国产乱码久久久久久1区2区 | 精品久久久久久无码专区不卡| 国产精品久久久久一区二区三区| 久久精品国产AV一区二区三区| 国产免费久久精品丫丫| 久久棈精品久久久久久噜噜| 欧美激情精品久久久久久久九九九 | 精品久久久久久亚洲精品| 亚洲国产成人久久精品99| 久久国产乱子精品免费女| 伊人久久大香线蕉av不变影院| 久久精品这里只有精99品| 中文字幕成人精品久久不卡 | 国产精品无码久久久久| 成人久久精品一区二区三区 | 久久久老熟女一区二区三区| 伊人色综合久久天天人守人婷| 99久久精品无码一区二区毛片| 99久久人妻无码精品系列| 久久久久久久人妻无码中文字幕爆| 亚洲欧洲久久久精品| 性做久久久久久免费观看| 亚洲欧洲精品成人久久曰影片 | 91精品日韩人妻无码久久不卡| 97久久超碰成人精品网站| 91精品国产91久久综合| 久久成人精品视频| 亚洲精品国产成人99久久|