Word Document Properties


Chapter 4: Storing and Modifying Information



Download 8,82 Mb.
Pdf ko'rish
bet80/207
Sana16.03.2022
Hajmi8,82 Mb.
#496217
1   ...   76   77   78   79   80   81   82   83   ...   207
Bog'liq
VBA For Dummies 5th Ed.pdf ( PDFDrive )

Chapter 4: Storing and Modifying Information
09_046500 ch04.qxp 12/5/06 5:54 PM Page 83


Object
, and 
Variant
. In addition to using the defined data types, you
can create user-defined data types so that you can mark the information as
needed for your program. A user-defined data type gives you the power to
extend the VBA interpretation of data. (The computer still looks at the data
as binary information.) Each of the data type descriptions that follows has a
different purpose, and you can work with the data type in a variety of ways.
Using strings for text
The first data type that I discuss in this chapter is one that you’ve already
seen in the message box examples: the string. When you create a message
box, you use a string as input. The string is the most useful and most-often
used data type in VBA.
In this chapter, I discuss only the essential string functions. VBA provides a
rich set of string manipulation functions. You can discover more about these
functions in the Working with Strings help topic. (Always access VBA help
topics from within the VBA Integrated Development Environment [IDE] by
using the Help

Microsoft Visual Basic Help command or by pressing F1.)
Understanding strings
Programmers often use fancy terms for things that the average person easily
recognizes. Strings are simply text, just like the text that you’re reading now.

string
is a sequence of characters. The characters aren’t always printable
but can include control characters that determine how the text appears
onscreen. A string can also include special characters, such as punctuation,
or even special features, such as a circumflex or an umlaut. Although a string
can contain all these elements, the main content of a string is always text.
Adding strings together with + or &
Sometimes you’ll want to concatenate two or more strings to make a longer
string. 
Concatenation
is the process of adding strings together. For example,
you might want to add a person’s first name to their last name to create their
full name. Often, you need to take information from more than one place and
join it together to create a new kind of information. You’ll see many examples
of concatenation as the book progresses.
Concatenation is so important that VBA provides a number of ways to do it.
The two most popular methods are using the 
+
(plus sign) or the 
&
(amper-
sand) symbol. Here are examples of both concatenation techniques:
MyVar = “A” & “B”
MyVar = “A” + “B”
84

Download 8,82 Mb.

Do'stlaringiz bilan baham:
1   ...   76   77   78   79   80   81   82   83   ...   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