velans.htm
来自「简单的说明如何使用VB,非常适合初学使用者,而且是用图表来解说的」· HTM 代码 · 共 3,096 行 · 第 1/3 页
HTM
3,096 行
<BR><LI>True; one can be local to one procedure and one local to another. You can also have a local variable that has the same name as a global variable. The local variable will be the active variable inside its procedure.<BR><LI>The values in local variables go away when the procedure ends.<BR><LI>The sending procedure<BR><LI>The receiving procedure<BR><LI>False<BR><LI>The variables that you pass are local to the calling function so the receiving function needs to know the data types of the arguments received.<BR><LI>False<BR><LI>False; you can pass several arguments to a function procedure but return only one value.<BR><LI>Two<BR><LI>Passed data may be changed by the receiving procedure and those changes remain in effect when the sending procedure regains control.<BR><LI>Passed data cannot be changed by the receiving procedure except within the boundaries of the receiving procedure.<BR><LI>Use the ByVal keyword or enclose passed arguments in parentheses.<BR><LI>The UBound() function<BR><LI>Global LastName As String<BR>Global Age As Integer<BR><LI>Global Const NDAYS = 7<BR>Global Const NMONTHS = 12<BR><LI>A. You must initialize a constant and constants cannot have data type declarations.<BR>B. Constants cannot have data type declarations.<BR>C. Always define constants using the Const keyword.<BR>D. You cannot initialize a global variable at the time that you define the variable.<BR><LI>Merle should never code the subscript value inside a receiving array's parentheses. Leave the parentheses blank and use the UBoumd() function inside the procedure to find the highest subscript in the array.<BR></OL><BR><A NAME="E68E202"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 9, <A HREF="vel17.htm">Unit 17</A></B></FONT></CENTER></H3><BR><OL><LI>File data<BR><LI>The user can select from drives, paths, and filenames when you use a dialog box. The user can too easily make mistakes when entering a filename in response to an input box.<BR><LI>A set of controls that get user information.<BR><LI>Add a frame to the form that holds the file controls. The frame lets you group the file controls together without interfering with other controls such as other list boxes.<BR><LI>Set the frame's Visible property to True or False.<BR><LI>Three<BR><LI>At runtime<BR><LI>A pattern, using the * and ? filename wildcard characters, that determine which files are to be displayed in the file list box.<BR><LI>When one file control changes, that change usually affects other file controls.<BR><LI>Manage the drive list box first because more is affected by the drive list box change than by changes made to the other file controls.<BR><LI>The directory and the filename list box controls.<BR><LI>The filename list box control is the only control that needs to be updated when the user changes the directory list box.<BR><LI>The DidCancel variable contains either True or False.<BR><LI>The Change event.<BR><LI>True<BR><LI>Both ACCT* and ACCT*.* work.<BR><LI>Both *.ex? and *.ex* work.<BR><LI>drvDisk.Drive = "d:"<BR>dirList.Path = "d:\vbprimer\direng" ' Root directory<BR></OL><BR><A NAME="E68E203"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 9, <A HREF="vel18.htm">Unit 18</A></B></FONT></CENTER></H3><BR><OL><LI>A collection of related data, programs, or a document.<BR><LI>To hold long-term data.<BR><LI>True as long as the files reside in separate directories or disks.<BR><LI>Open<BR><LI>Input, Output, and Append<BR><LI>the file number associates a file with a number.<BR><LI>Visual Basic creates the file.<BR><LI>Visual Basic overwrites the file.<BR><LI>Visual Basic creates the file.<BR><LI>Visual Basic adds to the end of the file.<BR><LI>Visual Basic displays an error.<BR><LI>1 to 255<BR><LI>False<BR><LI>FILES=<BR><LI>FreeFile()<BR><LI>Close<BR><LI>Close ensures that the file is safely stored away in case a power failure occurs.<BR><LI>The statement closes all open files.<BR><LI>Write#<BR><LI>A comma<BR><LI>A pound sign<BR><LI>A quotation mark<BR><LI>Input#<BR><LI>A line from a file<BR><LI>The Eof() function tests for the end of file.<BR><LI>Line Input#<BR><LI>"Peach", 34.54, 1, "98"<BR><LI>Rusty must use the following Line Input# command:<BR>Line Input #1, MyRecord<BR><LI>Close 3, 19<BR><LI>Open "names.dat" for Append As #7<BR><LI>Sub ReadData ()<BR>' Reads array data from a file and reports the data<BR>' Assume that 200 values were read<BR> Static CNames(200) As String, CBalc(200) As Currency<BR> Static CDate(200) As Variant, CRegion(200) As Integer<BR> Dim NumVals As Integer ' Count of records<BR> Dim ctr As Integer ' For loop control<BR> <BR> NumVals = 1 ' Start the count<BR> ' Reads the file records assuming<BR> ' four values on each line<BR> Open "c:\mktg.dat" For Input As #1<BR> Input #1, CNames(NumVals), CBalc(NumVals), CDate(NumVals), CRegion(NumVals)<BR> Do Until (Eof(1) = True)<BR> NumVals = NumVals + 1 ' Increment counter<BR> If (NumVals = 201) Then<BR> MsgBox "First 200 values are now read", MB_ICONEXCLAMATION<BR> Exit Do<BR> End If<BR> Input #1, CNames(NumVals), CBalc(NumVals), CDate(NumVals), CRegion(NumVals)<BR> Loop<BR><BR> ' When loop ends, NumVals holds one too many<BR> NumVals = NumVals - 1<BR> <BR> ' The following loop is for reporting the data<BR> For ctr = 1 To NumVals<BR> ' Code goes here that outputs the array<BR> ' data to the printer<BR> '<BR> Next ctr<BR> Close #1<BR><BR>End Sub<BR></OL><BR><A NAME="E68E204"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 10, <A HREF="vel19.htm">Unit 19</A></B></FONT></CENTER></H3><BR><OL><LI>The Menu Design window designs menus.<BR><LI>True<BR><LI>False<BR><LI>True<BR><LI>mnu<BR><LI>A pull-down menu that appears when you click a menu bar item.<BR><LI>The up and down arrow command buttons let you rearrange menu options.<BR><LI>The left and right arrow command buttons let you indent or remove indentions that indicate submenu items.<BR><LI>Checked<BR><LI>Visible<BR><LI>True<BR><LI>A single hyphen<BR><LI>Click<BR><LI>Chr$(8) (the backspace character) right-justifies menu bar items.<BR><LI>True<BR><LI>Frank needs to concatenate the Chr$(8) at runtime in the Form_Load() procedure.<BR><LI>mnuWindowSplit<BR><LI>mnuViewBar1 and mnuViewBar2<BR><LI>Select the Enabled property to gray out certain menu items.<BR></OL><BR><A NAME="E68E205"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 10, <A HREF="vel20.htm">Unit 20</A></B></FONT></CENTER></H3><BR><OL><LI>The Timer control<BR><LI>The Interval property<BR><LI>The user does not see the timer control on the running program's form.<BR><LI>Nothing.<BR><LI>False; the timer control triggers its own events.<BR><LI>Milliseconds<BR><LI>False<BR><LI>One thousandth of a second<BR><LI>Ten seconds<BR><LI>One minute<BR><LI>tmr<BR><LI>The Interval property can hold values larger than integers can hold.<BR><LI>Timer()<BR><LI>False; you can only trigger a timer event to occur repeatedly<BR><LI>The Windows environment can sometimes cause a Visual Basic application to skip a time interval<BR><LI>Add a timer control to the project with an Interval property value of 1000 so the timer event occurs every second. Update the time display inside the timer control's Timer() event procedure.<BR></OL><BR><A NAME="E68E206"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 10, <A HREF="vel21.htm">Unit 21</A></B></FONT></CENTER></H3><BR><OL><LI>Print<BR><LI>The Windows Print Manager collects all printing and routes the output to the appropriate printer.<BR><LI>The Windows Print Manager recognizes all installed printers so that individual programs do not have to.<BR><LI>Online means that the printer is ready and has paper.<BR><LI>Issue a message box that warns the user of subsequent output.<BR><LI>The Printer object is a generic Visual Basic object that collects all printed output and sends that output to the Windows Print Manager.<BR><LI>True<BR><LI>The smallest point on a printer or screen.<BR><LI>The Print method<BR><LI>False<BR><LI>False<BR><LI>The positive numbers each contain a hidden plus sign that does not print.<BR><LI>A zone is a kind of built-in tab stop that occurs every 14 columns of printed output.<BR><LI>True<BR><LI>Use Chr$(34)<BR><LI>True<BR><LI>The distance between the bottoms of the characters on one line to the bottoms of the characters on the line above.<BR><LI>Caroline is not taking into account the fact that Windows printers support different fonts and font sizes that may require calculation to find appropriate page lengths.<BR><LI>The second Print slips 10 spaces before printing, whereas the first Print begins printing in column 10.<BR><LI>Line1Line2<BR><LI>The Spanish N is ñ.<BR><LI>Printer.Print Tab(57); "America"<BR></OL><BR><A NAME="E68E207"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 11, <A HREF="vel22.htm">Unit 22</A></B></FONT></CENTER></H3><BR><OL><LI>The line and shape controls let you draw geometric shapes on a form.<BR><LI>Six<BR><LI>BorderStyle<BR><LI>The Shape property<BR><LI>The picture box control and the image control<BR><LI>The image control is more efficient than the picture box control.<BR><LI>Bitmaps, metafiles, and icons.<BR><LI>The Shrink property<BR><LI>The Picture property<BR><LI>LoadPicture()<BR><LI>Jean cannot change the line appearance for any line thicker than one twip.<BR><LI>Jean would have to draw several smaller thick lines to create the appearance of a single dashed line.<BR><LI>Nothing appears when the LoadPicture() function executes because of the null argument.<BR><LI>Indicate the blue border using the BorderColor property, the red diagonal line using the FillColor property, and the green interior with the BackColor property.<BR></OL><BR><A NAME="E68E208"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 12, Unit 23</B></FONT></CENTER></H3><BR><OL><LI>2<BR><LI>The user can select from the scroll bar's relative position instead of typing specific values.<BR><LI>The amount that the scroll bar values change when the user adjusts a scroll bar's value.<BR><LI>By clicking within the shaft on either side of the scroll bar.<BR><LI>The smallest and largest values that a scroll bar can represent.<BR><LI>hsb and vsb are the preferred naming prefixes.<BR><LI>True<BR><LI>Make sure that the grid's custom control file is added to the project.<BR><LI>GRID.VBX<BR><LI>False<BR><LI>One of the individual row and column intersection locations inside a grid.<BR><LI>False<BR><LI>When the grid's size is not large enough to display the full grid.<BR><LI>Row and Col<BR><LI>SelEndCol, SelEndRow, SelStartCol, and SelEndCol<BR><LI>12<BR><LI>MousePointer<BR><LI>The caret<BR><LI>The cursor<BR><LI>When a control's default MousePointer property is not the arrow. This typically occurs only for custom controls.<BR><LI>The hourglass<BR><LI>Through event procedure arguments<BR><LI>True<BR><LI>The number of fixed rows and fixed columns must be no more than two fewer than the total number of rows and columns. You will have to change the grid's Enabled property to False if you don't want the user to have any additional control over a grid.<BR><LI>Min: 32, Max: 212, SmallChange: 3, LargeChange: 8<BR></OL><BR><A NAME="E68E209"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 12, Unit 24</B></FONT></CENTER></H3><BR><OL><LI>Logic and syntax errors<BR><LI>Syntax error<BR><LI>A debugger is an online tool that lets you hunt down errors (bugs) in a program.<BR><LI>Use the Options Environment command to request interactive syntax checking.<BR><LI>True<BR><LI>False<BR><LI>Syntax errors are easier than logic errors to find.<BR><LI>Design mode, run mode, and break mode<BR><LI>Design mode<BR><LI>Look at Visual Basic's title bar to see the name of the current mode.<BR><LI>Break mode<BR><LI>Press Ctrl+Break, Select from the Run menu, click the break button on the toolbar, or set a breakpoint<BR><LI>A specific line that Visual Basic halts execution at during a program's run.<BR><LI>By highlighting the line of code and pressing F9, clicking on the toolbar, or by selecting from the Debug menu<BR><LI>Visual Basic highlights the breakpoint line<BR><LI>When Visual Basic reaches a breakpoint, Visual Basic halts the program's run before the breakpoint line executes.<BR><LI>Executing a program one line at a time, controllable by yourself instead of by Visual Basic.<BR><LI>The single footprint requests that Visual Basic single step through every line of code and the double footprint requests that Visual Basic single step through the breakpoint's current procedure but not single step through procedures called by the current procedure.<BR><LI>From the Instant Watch dialog box, you can look at variables and control values. From the Add Watch dialog box, you can request that Visual Basic enter a break mode when a certain expression becomes true or when a certain value is changed.<BR><LI>The Instant Watch is most handy for looking at variables during a breakpoint.<BR><LI>The Debug window<BR><LI>The Print method<BR><LI>The assignment statement<BR><LI>Jennifer must precede her Print methods with the Debug object.<BR></OL><P ALIGN=LEFT><A HREF="velxb.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 </BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?