📄 vel01.htm
字号:
<HTML><HEAD><TITLE>Visual Basic in 12 Easy Lessons vel01.htm </TITLE><LINK REL="ToC" HREF="index.htm"><LINK REL="Index" HREF="htindex.htm"><LINK REL="Next" HREF="vel02.htm"><LINK REL="Previous" HREF="velfm.htm"></HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080"><A NAME="I0"></A><H2>Visual Basic in 12 Easy Lessons vel01.htm</H2><P ALIGN=LEFT><A HREF="velfm.htm" TARGET="_self"><IMG SRC="purprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A><A HREF="index.htm" TARGET="_self"><IMG SRC="purtoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A><A HREF="vel02.htm" TARGET="_self"><IMG SRC="purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>TARGET="_self"><IMG SRC="purhome.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="See Page"></A><HR ALIGN=CENTER><P><UL><UL><UL><LI><A HREF="#E68E7" >What You'll Learn</A><LI><A HREF="#E68E8" >Why Write Programs?</A><LI><A HREF="#E68E9" >A Brief History of Textual Programming</A><UL><LI><A HREF="#E69E13" >Where Programmers Began</A><LI><A HREF="#E69E14" >Programming Languages Improved</A><LI><A HREF="#E69E15" >You Run Programs to Produce Output</A><LI><A HREF="#E69E16" >Exterminating Bugs Is Not Trivial</A><LI><A HREF="#E69E17" >Graphical User Interfaces Changed Everything</A></UL><LI><A HREF="#E68E10" >From BASIC to Visual Basic</A><LI><A HREF="#E68E11" >Homework</A><UL><LI><A HREF="#E69E18" >General Knowledge</A><LI><A HREF="#E69E19" >Extra Credit</A></UL></UL></UL></UL><HR ALIGN=CENTER><A NAME="E66E1"></A><H1 ALIGN=CENTER><CENTER><FONT SIZE=6 COLOR="#FF0000"><B>Lesson 1, Unit 1</B></FONT></CENTER></H1><BR><A NAME="E67E4"></A><H2 ALIGN=CENTER><CENTER><FONT SIZE=6 COLOR="#FF0000"><B>Introducing Visual Basic Programming</B></FONT></CENTER></H2><BR><BR><A NAME="E68E7"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>What You'll Learn</B></FONT></CENTER></H3><BR><UL><LI> [lb] Why write programs?<BR><BR><LI> [lb] A brief history of programming<BR><BR><LI> [lb] The steps needed to create programs<BR><BR><LI> [lb] Resolving program errors<BR><BR><LI> [lb] The difference between syntax and logic errors<BR><BR><LI> [lb] The transition from BASIC to Visual Basic<BR><BR></UL><P>This book is more than the usual computer disk and text combination. The book that you now hold contains a working copy of Microsoft Visual Basic For Windows, a complete Windows programming development system. Along with Visual Basic, you get a fantastic (if I may say so myself) introduction to programming within the Visual Basic environment. In addition to Visual Basic and the text, you also get every program listed in this book, so you can spend less time typing and more time learning.<BR><P>If you have programmed in other languages, hold on to your hats—Visual Basic is unlike other programming languages. The primary difference is that Visual Basic is <I>fun</I> to work with. The word <I>fun</I> simply does not apply to many other programming languages. With Visual Basic, you create most of your programs by clicking and moving your mouse. Instead of programming, you really <I>build</I> programs. Visual Basic is one of the few programming tools with which you can efficiently design your program while you create your program.<BR><P>This unit describes what programming is all about. You will learn a little about the history of programming, especially the movement of BASIC through computer history. (Visual Basic finds its roots in the more traditional BASIC language.) Get ready to learn how Visual Basic streamlines your programming life.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Note: </B>This unit spends a lot of time describing the background and importance of programming and early programming languages. This background serves two purposes. First, by learning about the history of programming, you will have a better idea where today's programming tools are headed. Second, you will appreciate more fully the incredible power, ease, and versatility that Visual Basic offers over other programming languages. Visual Basic's capabilities were beyond anyone's imagination just a few years ago.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><BR><A NAME="E68E8"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Why Write Programs?</B></FONT></CENTER></H3><BR><P><FONT COLOR="#FF8000"><B><I>Concept: </I></B></FONT>If you want your computer to do exactly what you want it to do, you must write a program.<BR><P>A computer does nothing on its own. In fact, a computer is a dumb machine with no intelligence whatsoever. Despite what you might read in science fiction stories, a computer does nothing more than blindly follow instructions supplied by a programmer. Computers cannot think.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><I>Definition: </I>A <I>program</I> is a set of instructions that tells the computer exactly what to do.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>When someone buys a computer today, the computer sits on the desk doing nothing until he loads a program into the computer's internal memory and starts running the program. Just as a VCR does not record shows on its own without being programmed to do so, a computer requires detailed instructions found only in programs.<BR><P>Suppose that you own rental properties and want to use your computer to track your tenant records. Your computer will not help you out in any way until you load and run a rental property program. Where do you find such a program? There are two ways to obtain programs for computers. You can<BR><UL><UL><P>Buy one and hope that the program does exactly what you want it to do.<BR></UL></UL><UL><UL><P>Write your own program.<BR></UL></UL><P>It's much easier and faster to buy a program that you need. Thousands of programs are on the market today. In fact, there are so many programs out there that you might not see the need for writing your own programs.<BR><P>If you can find a program that does exactly what you want, you are ahead of the game. If you find a program that meets your exact requirements, you should buy that program because purchasing a program is often less expensive and much quicker than writing the same program yourself or hiring programmers to write it for you.<BR><P>Think about this for a moment, though: If there are so many programs sold today that do virtually everything, why are programming languages such as Visual Basic continuing to break previous sales records each year? The answer is simple: People buy a computer so that the computer will do jobs that they need done. Firms cannot adapt their business to a computer program. They must find programs, or write their own programs, so that the computer processes information according to the business procedures already in place. The only way to ensure that a program exactly fits the needs of a firm is for the firm to develop its own programs.<BR><P>Business people are not the only ones who need custom-designed programs. No two people manage their finances exactly the same way; no two scientists need computers for exactly the same kinds of computations; and no two graphic artists need the same kinds of computer drawing tools. Although people buy spreadsheets and word processors for their general-purpose computing needs, many people require specialized programs for specific jobs.<BR><P>The art of programming computers is rewarding not only from a requirements standpoint, but also on a more personal level. Programming computers is fun! Just as a sculptor looks on a finished work of clay, programmers are often proud of the programs that they write. By the time you finish this book, you will have written programs that were not available before you wrote them. When you want your computer to do something specific and you cannot find a program that does the job exactly the way you want, you will be able to design and write the program yourself.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE>Some Programs are Changeable: There is a third method for getting exactly the program that you need if you want to computerize your company's accounting records. Accounting software firms often sell not only accounting programs but also the <I>source code</I> for those programs. The source code is a listing of the program's instructions. By having access to the source code, you can take what the software company wrote and modify the behavior of the program to suit your own requirements.<BR>By starting with a functional program instead of starting from scratch, you save programming time and money. Sadly, most non-accounting software firms do not supply the source code. Most programs sold today have been <I>compiled</I>. After compiling, the source code is translated into a locked-in executable program. The bottom line is that you cannot easily change the behavior of compiled programs. For most programs, therefore, you have the choice of buying them or writing them yourself from scratch.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><I>Definition: Code</I> is another name for program.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>There are many ways to write programs for computers. In the next section, you'll learn how the process of entering programs progressed from switches on the front of the computer to clicking and pointing with the mouse today. The majority of programs now in use are supplied in the form of code listings, which often comprise pages of line after line of computer instructions. Visual Basic helps take the drudgery out of coding—that is, writing—programs. Visual Basic enables you to move elements and place graphical images on the screen with the mouse instead of requiring that you give written and detailed screen instructions as required by languages that came before Visual Basic.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Tip: </B>For a complete description of the programming process, a comprehensive overview of programming languages, and a guided tour through the business of programming, check out <I>Absolute Beginner's Guide to </I><I>Programming</I> (Sams Publishing, 1993).</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P><FONT COLOR="#FF8000"><B><I>Review: </I></B></FONT>No single program pleases everyone. When a company sells a program, it must be general enough to please most purchasers. Some people need programs to behave in a specific manner in order to fulfill a specific need. They must resort to writing their own programs. Luckily, Visual Basic takes a lot of the pain out of writing programs.<BR><BR><A NAME="E68E9"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>A Brief History of Textual Programming</B></FONT></CENTER></H3><BR><P><FONT COLOR="#FF8000"><B><I>Concept: </I></B></FONT>Computers cannot understand just any language. You must learn a language that your computer knows before you can write programs for your computer.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><I>Definition: </I>An <I>application</I> is yet another name for program.</NOTE><BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -