Word Document Properties


Figure 6-5: Use the Locals window to see visible variables. 151 Chapter 6: Trapping Errors and Squashing Bugs



Download 8,82 Mb.
Pdf ko'rish
bet134/207
Sana16.03.2022
Hajmi8,82 Mb.
#496217
1   ...   130   131   132   133   134   135   136   137   ...   207
Bog'liq
VBA For Dummies 5th Ed.pdf ( PDFDrive )

Figure 6-5:
Use the
Locals
window to
see visible
variables.
151
Chapter 6: Trapping Errors and Squashing Bugs
11_046500 ch06.qxp 12/5/06 5:35 PM Page 151


Two objects appear next in the list. Normally, just the object name appears in
the list. Click the plus sign next to the name, and you see the object proper-
ties and their values. Notice that the 
MyDrive.AvailableSpace
property
matches the 
FreeSpace
value because I stopped the program immediately
after the drive space assignment. (See the earlier “Recovering from an error”
section for details.)
Objects can contain other objects. 
MyDrive
is a 
Drive
object that contains a
RootFolder
object. Notice the plus sign next to 
RootFolder
in Figure 6-5.
Click this plus sign, and the Locals window shows the contents of the second
object. You can continue looking through a hierarchy of objects until you
reach the last one contained within the original object.
The Locals window is also handy for playing what-if scenarios with your pro-
gram. The 
DriveTest
program always fails because the check value is too
high. You can double-click the Value field of the 
FreeSpace
entry to change
its value to 1,000,000,001. The check passes now because 
FreeSpace
is one
more than the check value. Try this test; the program exits without error.
Using the Watches Window
The Watches window works similarly to the Locals window, but has a differ-
ent purpose. The Locals window shows variables in their raw format and
only the variables that you can see locally. You might want to see other vari-
ables, or you can use a function to change a variable before viewing it. The
Watches window helps you perform these kinds of tasks, but it requires a
little more work to use. You can display the Watches window by clicking the
Watch Window button on the toolbar. Figure 6-6 shows a typical example of
the Watches window.
Notice that this window adds a Context field. This field tells you where a vari-
able is defined. Because you can use variables from any location, knowing
where they come from is important.

Download 8,82 Mb.

Do'stlaringiz bilan baham:
1   ...   130   131   132   133   134   135   136   137   ...   207




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish