Powerful PowerPoint for Educators: Using Visual Basic for Applications to Make PowerPoint Interactive


De bug ging Tips In tro duc tion


Download 1.37 Mb.
Pdf ko'rish
bet158/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   154   155   156   157   158   159   160   161   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

9
De bug ging Tips
In tro duc tion
In Chapter 8 you added to your bag of tricks. Whether you are ready to ven-
ture out on your own, writing scripts that are more than mi nor mod ifications of
the examples in this book, or are simply copy ing more and more complex exam-
ples, you are bound to make mistakes. This chap ter describes sev eral ways to
track down your mistakes and avoid making mistakes in the first place, and
points you to some com mon mistakes for which you can look when your code
seems like it should work, but it doesn’t.
Vo cab u lary
• Bug
• Debug
• Cap i tal iza tion
• In dent ing
• Com pile er ror
• Run time error
• Com ment ing out
My Scripts Al ways Work the First Time
If you have tried more than one or two ex amples in this book, you are al -
most cer tain to have made at least one mistake. In com puter terms, mistakes are
called bugs. This term co mes from the time when com puters were as big as en -
tire rooms and real bugs were a problem:


American en gineers have been call ing small flaws in ma -
chines “bugs” for over a century. Thomas Edison talked about
bugs in electrical cir cuits in the 1870s. When the first comput-
ers were built dur ing the early 1940s, peo ple working on them
found bugs in both the hardware of the ma chines and in the
programs that ran them.
In 1947, en gineers working on the Mark II com puter at Har-
vard University found a moth stuck in one of the components.
They taped the in sect in their log book and labeled it “first ac -
tual case of bug be ing found.” The words “bug” and “debug”
soon be came a standard part of the lan guage of com puter pro-
gram mers. (Smith so nian Na tional Mu seum of Amer i can His-
tory, n.d.)
The pro cess of fixing bugs is called debugging. If you follow the ex amples
in this book ex actly, de bugging is not dif ficult; you simply compare what you
typed to the ex ample and find the dif ference. Once you get a lit tle more adven-
turous and try to make a few small changes to the scripts, you will need some
ideas to help you solve problems.

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   154   155   156   157   158   159   160   161   ...   191




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