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


x = x + 1 would not make any sense. In the computer, it makes perfect sense for two reasons: 1. While the variable x


Download 1.37 Mb.
Pdf ko'rish
bet44/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   40   41   42   43   44   45   46   47   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

x = x + 1
would not make any sense. In the computer, it makes perfect sense for two reasons:
1.
While the variable
x
can only hold one value at a time, that value can
change. At one time
x
might hold the value 7, and a mo ment later,
x
might hold the value 8.
2.
The equal sign (
=
) is not a state ment of equal ity. It is an as signment
operator. It says, take the value on the right side and store it in the
variable named on the left side. Therefore, the above equation is not a
statement of al gebraic fact; it is an ac tion. The part on the right (
x + 1
)
says, find what the value of
x
is and add one to it
; the rest (x =
) says,
50 Let’s Get Scripting


store that value in 
x
. That is, if 
x
was 7, it will now be 8. Us ing the
box analogy, it says, look in the box we call “x,” add one to what you
find there, and put the result back in the box.
In the 
YourName
procedure, we have used the variable
userName
. What
we have said is: Take whatever the user types in the 
InputBox
and put it into a
vari able called
userName
. Later, we will want to use the name (to say, for ex am-
ple, “Good job, Ella”) so we will get it out of the 
userName
box when we are
ready.
Note that 
InputBox
does not work prop 
erly in
PowerPoint 98 for the Macintosh. It works fine in all later
Macintosh versions (PowerPoint 2001 and later) and in all
Windows versions (PowerPoint 97 and later). If you are
working in PowerPoint 98, you should prob ably up grade
to a later version. In the meantime, you can still work with
the

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   40   41   42   43   44   45   46   47   ...   191




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