最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Debug::assert In MS Dynamics Axapta

网络文摘 William 1822浏览 0评论

This method allows to check if some Boolean condition evaluates to true and if it doesn't - stop further execution and show stack trace. Debug::assert() should be used to validate some assumptions made in the code which should never happen if nothing is broken in the application. It means that wrong user input should not be asserted but rather validated by normal if statement and exception should be thrown if the input is wrong. However, if the code relies, for example, on query data source name, which can be broken only in development time - that is a good place to add assert to.


Example:
    Query query = new Query(querystr(Alertsetup));
    QueryBuildDataSource qbds;
    ;

    qbds = query.dataSourceName(identifierstr(EventRule));
    Debug::assert(qbds != null);
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址