velans.htm
来自「简单的说明如何使用VB,非常适合初学使用者,而且是用图表来解说的」· HTM 代码 · 共 3,096 行 · 第 1/3 页
HTM
3,096 行
<BR>B. True<BR>C. True<BR>D. True<BR>E. True<BR>F. False<BR><LI>The ASCII table<BR><LI>The If statement makes decisions (as well as the Select Case)<BR><LI>The If-Else statement<BR><LI>False<BR><LI>A nested If is an If statement within another If statement<BR><LI>The Select Case<BR><LI>Four: Case value, Case Is, Case To, and Case Else<BR><LI>Nothing happens and control falls to the statement following the End Select statement<BR><LI>The code in the Case Else executes before control returns to the statement following the End Select statement<BR><LI>Case To<BR><LI>Case Is<BR><LI>If (M = 3) AND (P = 4) Then<BR> TestIt = "Yes"<BR>End If<BR><LI>If (d >= 3) Or (p < 9) Then<BR><LI>Select Case Age<BR> Case Is <0: lblTitle.Text = "Age Error"<BR> Case Is <5: lblTitle.Text = "Too young"<BR> Case 5: lblTitle.Text = "Kindergarten"<BR> Case 6 To 11: lblTitle.Text = "Elementary"<BR> lblSchool.Text = "Lincoln"<BR> Case 12 To 15: lblTitle.Text = "Intermediate"<BR> lblSchool.Text = "Washington"<BR> Case 16 To 18: lblTitle.Text = "High School"<BR> lblSchool.Text = "Betsy Ross"<BR> Case Else: lblTitle.Text = "College"<BR> lblSchool.Text = "University"<BR>End Select<BR><LI>There is no End Else statement.<BR></OL><BR><A NAME="E68E194"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 5, <A HREF="vel09.htm">Unit 9</A></B></FONT></CENTER></H3><BR><OL><LI>A comment that helps explain a program's logic.<BR><LI>To help aid programmers with program maintenance.<BR><LI>False<BR><LI>True<BR><LI>Two: The Rem statement and the apostrophe remark<BR><LI>To state the programmer's name and the date the program was written<BR>To describe in the <U>(general)</U> procedure the overall goal of the program<BR>To describe at the top of all procedures the overall goal of that procedure<BR>To explain tricky or difficult statements so that others who modify the program later can understand the lines of code without having to decipher cryptic code<BR><LI>Programmers<BR><LI>False; add remarks when you write your program so you'll be able to understand the program more easily when you modify it later.<BR><LI>False<BR><LI>Specify a type value that signifies which group of command buttons you need.<BR><LI>By specifying a msg value.<BR><LI>Modal indicates whether or not the user must respond to a message box before switching to another application.<BR><LI>True<BR><LI>False<BR><LI>To get answers<BR><LI>Strings and variants<BR><LI>Check for a null string, "", to see if the user pressed Cancel or OK.<BR><LI>Press the OK command button (or press Enter which clicks the OK command button)<BR><LI>Four<BR><LI>None<BR><LI>Use a proper type value<BR><LI>Seven<BR><LI>Seven<BR><LI>Make sure that the type argument includes the value of 4096 or the MB_SYSTEMMODAL named constant.<BR><LI>Bob can use the only the apostrophe if he wants to include a remark at the end of a line. Bob must change the code to this:<BR><LI> do until (endOfFile) ' Continue until the end <BR></OL><BR><A NAME="E68E195"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 5, <A HREF="vel10.htm">Unit 10</A></B></FONT></CENTER></H3><BR><OL><LI>A loop is the repetition of a block of Visual Basic statements.<BR><LI>Five<BR><LI>Four<BR><LI>True<BR><LI>A loop that repeats forever (at least until the user intervenes to stop the loop)<BR><LI>Keep asking the user for the answer, using a loop, until the user enters a correct response.<BR><LI>9<BR><LI>10<BR><LI>0<BR><LI>10<BR><LI>1<BR><LI>The For statement<BR><LI>The Do statement<BR><LI>The Do While loop continues executing while a relational test is true, whereas the Do Until loop continues executing while a relational test is false.<BR><LI>Visual Basic checks the relational test at the top of the loop using a Do While statement, whereas, Visual Basic checks the relational test at the bottom of the loop using a Do-Loop While statement.<BR><LI>An iteration is one complete loop cycle.<BR><LI>Use a negative Step value.<BR><LI>The increment's Step value must be negative.<BR><LI>The Exit Do and the Exit For statements end loops before their natural termination.<BR><LI>Dim Guess, Ans As Integer<BR>Guess = 34 ' The user must guess this<BR>Do<BR> Ans = InputBox("Make a guess...", "Guessing Game")<BR> ' Tell the user about the wrong guess<BR> If (Ans <> Guess) Then<BR> MsgBox "You guessed incorrectly. Try again."<BR> End If<BR>Loop While Ans <> Guess<BR><LI>Larry changes the variable named i inside the loop, keeping the For loop's controlling variable from ever triggering the end of the loop.<BR><LI>Kim must switch the starting and ending values like this:<BR>For I = 1 To 100 Step 1<BR></OL><BR><A NAME="E68E196"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 6, <A HREF="vel11.htm">Unit 11</A></B></FONT></CENTER></H3><BR><OL><LI>Arrays let you step through large amounts of data without the need to reference multiple variable names.<BR><LI>A single item from the array's list of values<BR><LI>The array subscript is the number that references different array elements.<BR><LI>One<BR><LI>20<BR><LI>True<BR><LI>Use the subscript<BR><LI>The Static statement defines arrays<BR><LI>1<BR><LI>The For loop works best for array processing.<BR><LI>List and combo boxes<BR><LI>False<BR><LI>True as long as the MultiSelect property is set to True.<BR><LI>True<BR><LI>The methods initialize, count, and remove items from list and combo box controls.<BR><LI>The AddItem method<BR><LI>True<BR><LI>False<BR><LI>True<BR><LI>True<BR><LI>The Selected method<BR><LI>False<BR><LI>The Sorted property<BR><LI>Static StdAges(3) As Integer<BR><LI>The MultiSelect property<BR><LI>Sub cmdGoAway_Click()<BR> lstVals.Clear<BR>End Sub<BR><LI>The command button can trigger an event procedure that uses the AddItem method to add the new item to the combo box.<BR><LI>Carla cannot define a list box as if the list box were a variable array. Carla must use the list box control on the Toolbox window to place a list box on the form.<BR></OL><BR><A NAME="E68E197"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 6, <A HREF="vel12.htm">Unit 12</A></B></FONT></CENTER></H3><BR><OL><LI>The option button<BR><LI>The check box<BR><LI>Option buttons imitate older radios with push button station selectors.<BR><LI>The first option button will no longer be selected.<BR><LI>True<BR><LI>The Alignment property determines if the option or check box description appears to the right or left of the button or check box.<BR><LI>The Value property<BR><LI>The Value property<BR><LI>False<BR><LI>True<BR><LI>A holder of other controls such as option buttons.<BR><LI>False<BR><LI>A special character that performs an action on the screen.<BR><LI>Concatenate a combination of carriage-return/line feed character strings within text to break the lines onto separate label lines.<BR><LI>Changes a number to its ASCII character equivalent.<BR><LI>An array of controls that are the same control type.<BR><LI>All arrays, including control arrays, have only one name.<BR><LI>By a subscript<BR><LI>Zero<BR><LI>One<BR><LI>Index<BR><LI>By displaying a message box that makes sure you want to create a control array.<BR><LI>cmdAll_DblClick (Index As Integer)<BR><LI>Opal needs to draw her application's option buttons <I>within</I> their frames, not move them into the frames.<BR></OL><BR><A NAME="E68E198"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 7, <A HREF="vel13.htm">Unit 13</A></B></FONT></CENTER></H3><BR><OL><LI>An argument is a value that you pass to a function inside the function's parentheses.<BR><LI>False<BR><LI>True<BR><LI>False<BR><LI>There are three different integer functions because there are different ways to round numbers.<BR><LI>A. 61<BR>B. -62<BR>C. -61<BR>D. 422<BR><LI>False; <U>CInt()</U> is a true rounding function whereas Int() and Fix() always round positive arguments down to the integer equal to or lower than the argument.<BR><LI>The Asc() function is the mirror-image function to Chr$().<BR><LI>A. "ABCDEFG"<BR>B. "abcdefg"<BR><LI>Anything would hold the string "78.1"<BR><LI>A. S<BR>B. Sam<BR>C. <BR>D. ams<BR>E. ams<BR><LI>True, see question #18 and #19.<BR><LI>True<BR><LI>Str$() (or Str())<BR><LI>Pass the numeric value to <U>Str$()</U> before concatenating the value to the prompting string.<BR><LI>Send to <U>Len()</U> a double-precision variable and multiply the result by 250.<BR><LI>Dim ANum, ANumSq As Single<BR>ANum = Val(InputBox$("Enter a number to square"))<BR>MsgBox "The square of your number is" & Str$(Sqr(ANum))<BR><LI>First = InputBox$("What is your first name?")<BR>Last = InputBox$("What is your last name?")<BR>MsgBox "Your name has" & Str$(Len(First) + Len(Last)) & "letters"<BR><LI>ValAsc = Asc("P")<BR><LI>Rudy needs to convert the weight value to a long integer because he is computing a value too large for an integer result.<BR></OL><BR><A NAME="E68E199"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 7, <A HREF="vel14.htm">Unit 14</A></B></FONT></CENTER></H3><BR><OL><LI>True<BR><LI>The time and date functions get their values from your computer's internal clock and calendar.<BR><LI>24-hour times do not use the AM or PM designators. Add 12 to all times after 12:59 PM to get the 24-hour time.<BR><LI>True<BR><LI>False<BR><LI>19:54<BR><LI>Date$() returns a string and Date() returns a variant data type.<BR><LI>False; Visual Basic supports only a Now() function.<BR><LI>Now() returns a value based on the 12-hour clock.<BR><LI>False<BR><LI>False; Date and Time (statements not functions) set your computer's date and time.<BR><LI>Date$()<BR><LI>Timer() returns the number of seconds since midnight as a double-precision value.<BR><LI>A byte is a character of memory.<BR><LI>The VarType 7 data type<BR><LI>TimeValue() accepts three argument values, the hour, minute, and second, and forms a time whereas Hour(), Minute(), and Second() all accept a full time value and return individual pieces of the time.<BR><LI>A logical value is the result of a relational comparison.<BR><LI>Format() and Format$()<BR><LI>Format() returns a variant data type and Format$() returns a string.<BR><LI>A thousands separator is a comma (or period for some international settings) that separates every three digits to the left of the decimal point in values more than 999.<BR><LI>The "Fixed" fixed-format string does not enclose negative values in parentheses and does not display a thousands separator in large numbers.<BR><LI>Time$ will not accept 12-hour values that contain the AM or PM designator. You can use the Right$() function to see if the user happened to enter AM or PM.<BR></OL><BR><A NAME="E68E200"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 8, <A HREF="vel15.htm">Unit 15</A></B></FONT></CENTER></H3><BR><OL><LI>Technically, the answer is false. We're splitting hairs, however. An event procedure is a specialized form of a subroutine procedure.<BR><LI>Use the Call statement to call subroutine procedures.<BR><LI>Use the function procedure's name inside an expression or statement.<BR><LI>You can select from the View menu bar command or type Sub or Function below another procedure in the Code window.<BR><LI>If a dollar sign appears after the function name, the function returns a string.<BR><LI>A function procedure returns a value back to the calling procedure.<BR><LI>Assign the function's return value to the function name as if the function name were a variable.<BR><LI>F2<BR><LI>The programmer must supply the code for function procedures.<BR><LI>Module<BR><LI>.BAS<BR><LI>You do not yet know how to pass data between procedures.<BR><LI>Option Base and Option Explicit<BR><LI>True<BR><LI>True<BR><LI>Sub PrReport()<BR><BR>End<BR><LI>Function GetValue()<BR><BR>End Function<BR><LI>GetPi = 3.14159<BR><LI>There are no parentheses around the argument list so you cannot use the <U>Call</U> keyword.<BR></OL><BR><A NAME="E68E201"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 8, <A HREF="vel16.htm">Unit 16</A></B></FONT></CENTER></H3><BR><OL><LI>Local<BR><LI>Module<BR><LI>Global<BR><LI>False<BR><LI>True<BR><LI>True<BR><LI>Global<BR><LI>Module<BR><LI>As global constants<BR><LI>Defined global named constants<BR><LI>Nowhere else in the program are you allowed to assign values to constants.<BR><LI>In the (general) procedure of a non-form module.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?