Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Alison Balteramp;#039;s Mastering Microsoft Office Access 1002003 [Electronic resources] - نسخه متنی

Alison Balter

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



Using Assertions


You use assertions to ensure that, if the user encounters a certain state, your code invokes the debugger. The following code, found in basExamples, is an example:

Sub Assertion()
Dim intAge As Integer
intAge = InputBox("Please Enter Your Age")
Debug.Assert (intAge >= 0)
MsgBox "You are " & intAge
End Sub

This example sets the value of a variable called intAge equal to the value entered into an Input Box. The Debug.Assert statement "asserts" that the value entered is greater than or equal to zero. If it is, code execution proceeds as expected. If the assertion is

incorrect, the code invokes the debugger.

It is a good idea to include a comment as to why an assertion might fail. By doing this, you will facilitate the process of responding to the situation when it occurs. Also, it is important to realize that, if you deploy your application with Debug.Assert statements intact, you will receive a technical support call when an assertion fails, and your code places the user in the debugger without warning!


/ 544