• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Understanding Objects > Introducing Objects

Introducing Objects

You’ve seen quite a few variables so far in this book. Recall that a variable is a named part of VBA code that holds a single value (for example, a number or a string of characters). Or in the case of an array variable, the variable can store multiple related values. But so far you’ve been exposed to only one type of variable, which you might call a simple variable (sometimes you’ll see the technical term scalar variable used for this type). There’s actually a second type called object variables, or just objects. An object variable is a variable that also includes behavior. This concept is often tough for beginners to grasp, so this section starts by exploring an analogy that will help you understand how objects work.

Digressing into the Real World

To understand objects, you’re going to look at a real-world object. Specifically, this section discusses the sort of toy radio-controlled car that has been popular with kids (and software developers!) for many years. Here are three key facts about a typical such car:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint