📄 vel01.htm
字号:
to Visual Basic, although C and FORTRAN differ greatly in their approach and syntax. Nevertheless, C programmers face great challenges when using C for Windows programs because languages such as C are procedural whereas Windows is event-driven.<BR><P>Several powerful programming solutions have been devised that aid Windows programmers. A relatively new programming concept called <I>object-oriented programming</I> (or <I>OOP</I> for short) better lends itself to Windows-like event-driven programming than languages such as FORTRAN, BASIC, or C. Even OOP, however, puts a strain on its programmers that today's busy and backlogged programming departments do not have the resources to handle.<BR><P>The big problem is that as computers get easier for users by supplying graphical environments such as Windows, the programs that the users use become harder to develop. Therefore, as the demand for these GUI programs increase, so does the backlog of programs that need to be written.<BR><P>Microsoft introduced a new programming language, Visual Basic, a few years ago. The advantages of Visual Basic became immediately apparent. They are<BR><UL><LI> [lb] Visual Basic is based on the QBasic programming language, so programming newcomers find Visual Basic friendlier than other languages.<BR><BR><LI> [lb] Visual Basic is designed from the ground up to be a Windows programming language. Inherent in Visual Basic's fundamental design is the event-driven program concept. As a matter of fact, textual procedural-based programs are difficult to write using Visual Basic.<BR><BR><LI> [lb] Visual Basic is graphical in its programming approach. You can literally create a complete and working Visual Basic program by moving picture icons on and off the screen without ever writing one command in Visual Basic's programming language.<BR><BR></UL><P>The great thing about Visual Basic is that the program looks almost exactly like the output screen that results. In other words, to design and write the simple program that produced Figure 1.3, you would place text, buttons, and lines onto the screen, using the visual tools supplied with Visual Basic, until your "program" looked like what you wanted your finished Windows program to look like. Such placement of visual elements would takes pages and pages of typed instructions using a traditional procedural programming language.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Note: </B>After the success of Visual Basic for Windows, Microsoft developed Visual Basic for DOS. Visual Basic for DOS found extremely limited success, however, and is now extinct.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>Before you can learn to program with Visual Basic, you must get a feel for the tool itself. The second half of this lesson, <A HREF="vel02.htm">Unit 2</A>, introduces you to Visual Basic itself. You will learn how to install the Visual Basic disk that comes with this book, start Visual Basic, and manipulate the screens of Visual Basic. Once you master the mechanics of Visual Basic, the second lesson dives right into programming by walking you through your first full-functional Visual Basic application from design to execution.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE>Visual Basic is Event-Driven and Procedural: Don't think that the days of program listings are gone forever. As a matter of fact, one of the most important components of Visual Basic is its procedural BASIC-like programming language underneath the visual environment. When you begin to extend your Visual Basic programming by developing more powerful programs, you will need to combine the visual elements of the language with the QBasic-like routines.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Warning: </B>This unit ends here without describing the details of Visual Basic because Visual Basic's details are the <I>rest</I> of this book's job. Now that you have a fundamental grasp of programming and the Windows programming challenges, you are ready to begin taking a rewarding tutorial of Visual Basic for the remainder of this book. In twelve easy lessons, you will be a Visual Basic master!</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P><FONT COLOR="#FF8000"><B><I>Review: </I></B></FONT>In many ways, writing programs the old-fashioned way—that is, writing page after page of text instructions that the computer will eventually follow—is somewhat like a long and arduous recipe. The cook starts at the first instruction in the recipe and must be careful not to skip steps. Such listings are vital, and although the recipe might throw in a picture or two, the cook must follow the recipe sequentially if the finished meal is to taste good.<BR><P>Writing programs with Visual Basic is much more akin to using a VCR than following a step-by-step recipe. In all fairness, though, even the most complicated of VCRs are easier to program than complex Visual Basic applications. Visual Basic, though, is still one of the easiest and fastest tools you can find to develop Windows applications.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Note: </B>Most of the parts in this book end with a Review as well as a Stop & Type section, which enables you reinforce the section's topics with a hands-on programming exercise. The primary purpose of this first unit has been to teach you the basics of programming from a historical perspective. Therefore, there are no hands-on topics for this unit.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><BR><A NAME="E68E11"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Homework</B></FONT></CENTER></H3><BR><BR><A NAME="E69E18"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>General Knowledge</B></FONT></CENTER></H4><BR><OL><LI>What is a program?<BR><BR><LI>If you attempt to use a computer that has no running program, what's the result?<BR><BR><LI>What are two ways to obtain programs for your computer?<BR><BR><LI>What is the advantage of writing your own programs?<BR><BR><LI>What is the disadvantage of writing your own programs?<BR><BR><LI>True or false: Some vendors sell programs that you can customize to suit your own needs.<BR><BR><LI>What is code?<BR><BR><LI>What is a bug?<BR><BR><LI>What are the two kinds of errors called?<BR><BR><LI>If you misspell a Visual Basic command, what kind of error have you violated?<BR><BR><LI>What kind of error does Visual Basic find for you?<BR><BR><LI>What is the hardest kind of error to find?<BR><BR><LI>How were the earliest computers programmed?<BR><BR><LI>How did adding switches to the front of early computers improve the programmability of those computers?<BR><BR><LI>The earliest programming language, called <I>machine language,</I> consisted of combinations of On and Off states produced by the switch panel. What did these On and Off combinations represent?<BR><BR><LI>The addition of which piece of hardware made it possible for more people to access computers and program them?<BR><BR><LI>What do you call the code entered by the programmer?<BR><BR><LI>At the lowest level, what does every high-level programming language become before the computer can understand the language?<BR><BR><LI>What was the name of one of the earliest high-level programming languages that is still in use today for scientific and mathematical programming?<BR><BR><LI>What language did some Dartmouth professors develop to overcome the fears that some of the existing programming languages produced?<BR><BR><LI>What does BASIC stand for?<BR><BR><LI>What kind of programming languages lend themselves well to text-based DOS environments?<BR><BR><LI>What kinds of programming languages lend themselves well to Windows-like environments?<BR><BR><LI>What does GUI mean?<BR><BR><LI>Give two examples of an event.<BR><BR><LI>What challenges must an event-driven program overcome?<BR><BR><LI>True or false: Visual Basic does not contain any procedural programming tools because none are useful for GUI environments.<BR><BR><LI>True or false: A Visual Basic program often looks like its own output.<BR><BR></OL><BR><A NAME="E69E19"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>Extra Credit</B></FONT></CENTER></H4><BR><OL><LI>A programmer does not sit down in front of a computer and start typing a finished program—although Visual Basic makes programming almost that easy. Describe the steps necessary to produce a program.<BR><BR><LI>Why should programmers thoroughly test the programs that they write?<BR><BR></OL><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Note: </B>Because this unit was descriptive, it contains no What's the Output?, Find the Bug, or Write Code That... sections.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><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="#I0" TARGET="_self"><IMG SRC="purtop.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Page Top"></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></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -