Using Labels
In early versions of BASIC, every line of code required a line number. For example, if you had written a BASIC program in the ’70s (dressed, of course, in your bell bottoms), it may have looked something like this:
10: LET X=5
20: LET Y=3
30: LET Z=X*Y
40: PRINT Z
50: END
VBA permits the use of such line numbers, and it even permits text labels. You don’t typically use a label for each line, but you may occasionally need to use a label. For example, insert a label if you use a GoTo statement (which I dis-cuss in Chapter 10). A label must begin with the first nonblank character in a line and end with a colon.
The information in this article becomes clearer as you read subsequent articles. If you want to find out more about VBA language elements, I refer you to the VBA Help system. You can find as much detail as you need, or care, to know.
No comments:
Post a Comment