• <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++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

                   本文章將試著講述一些好的習(xí)慣,它或許可以幫助你更快更容易的找出問題的解決方案(原文: 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.)。

             

                   注冊時一定要檢查的返回值,至少在調(diào)試模式下配置腳本引擎的時候,一定要檢查返回值,(原文:Always check return values for registrationsWhen configuring the script engine you should always check the return values, at least in debug mode)。【當(dāng)構(gòu)建失敗時,幾乎所有的錯誤代碼都可以用一個像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.)】。

                  

            如果一個函數(shù)在構(gòu)建期間失敗了,則構(gòu)建方法總是會失敗,并返回一個asINVALID_CONFIGURATION的錯誤碼。 (原文: If a function failed during the configuration, the Build method will always fail with a return code of asINVALID_CONFIGURATION.)。錯誤總是不可確定,除非你總是檢查所有函數(shù)調(diào)用的錯誤碼(原文: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()可以被安全的使用,當(dāng)有一個函數(shù)失敗時,引擎被設(shè)置為構(gòu)建無效的內(nèi)部狀態(tài)。(原文:

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

             

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

             

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

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

             

             

                                                                                                                    ---------  besterChen

                                                                                                                     譯于 2010410星期六
            97久久国产亚洲精品超碰热 | 亚洲国产精品一区二区久久hs| 色偷偷888欧美精品久久久| 久久久久久国产a免费观看不卡| 99久久er这里只有精品18| 91久久婷婷国产综合精品青草| 精品一区二区久久| 久久综合久久性久99毛片| 狠狠色婷婷久久一区二区 | 久久国产热精品波多野结衣AV | 超级碰久久免费公开视频| 久久久久香蕉视频| 午夜精品久久久久久中宇| 国产精品岛国久久久久| 香蕉久久夜色精品国产尤物| 久久国产精品久久精品国产| 2020久久精品亚洲热综合一本| 久久久久国产精品| AV无码久久久久不卡蜜桃| 久久AAAA片一区二区| 国内精品久久久久影院优| 性做久久久久久久久浪潮| 久久国产一片免费观看| 久久99热狠狠色精品一区| 人妻精品久久久久中文字幕69| 久久久久综合国产欧美一区二区| 国产精品99久久久久久人| 日韩av无码久久精品免费| 亚洲日本va午夜中文字幕久久| 国产高潮国产高潮久久久91 | 久久99精品久久久久久久不卡| 欧美成人免费观看久久| 日韩AV毛片精品久久久| 久久97久久97精品免视看| 国内精品久久久久久久久电影网 | 亚洲欧洲久久久精品| 热综合一本伊人久久精品| 亚洲国产成人久久一区WWW| 亚洲精品美女久久久久99小说 | 亚洲国产精品无码久久SM| 久久久久人妻一区二区三区|