For instance , the following syntax enables assertion checking for the 例如,下面的語法對(duì)
Now , run the program with assertion checking enabled 現(xiàn)在,請(qǐng)帶有啟用斷言檢查運(yùn)行該程序:
For instance , the following syntax will enable assertion checking for the 例如,下面的語法將對(duì)
Option , to enable assertion checking 選項(xiàng)來啟用斷言檢查。
Because these assertions check for changes in the model , not the view 因?yàn)檫@些斷言只是在模型中,而不是在視圖中檢查發(fā)生的更改。
Running the program with assertion checking enabled produces the following error report 帶啟用斷言檢查運(yùn)行程序產(chǎn)生下面的錯(cuò)誤報(bào)告:
Because assertion checking is disabled by default no assertion error is detected 由于在缺省情況下禁用了斷言檢查,因此不會(huì)檢測到任何斷言錯(cuò)誤。
The following simple example walks you through the necessary steps to add assertion checking to your program 下面的簡單示例向您介紹了向程序中添加斷言檢查的一些必要步驟。
Assertion checking is disabled by default , so you ll also have to explicitly enable this facility at run time 缺省情況下,會(huì)禁用斷言檢查,因此在運(yùn)行時(shí)您也要顯式地啟用這一功能。
Assertion checking is like exception handling , but no exception is thrown when an assertion fails . instead , an 斷言檢查就象異常處理,但是當(dāng)斷言失敗時(shí),卻不會(huì)拋出異常,而會(huì)拋出一個(gè)