Visual Basic in 12 Easy Lessons velans.htm
-
Lesson 1, Unit 1
-
Lesson 1, Unit 2
-
Lesson 2, Unit 3
-
Lesson 2, Unit 4
-
Lesson 3, Unit 5
-
Lesson 3, Unit 6
-
Lesson 4, Unit 7
-
Lesson 4, Unit 8
-
Lesson 5, Unit 9
-
Lesson 5, Unit 10
-
Lesson 6, Unit 11
-
Lesson 6, Unit 12
-
Lesson 7, Unit 13
-
Lesson 7, Unit 14
-
Lesson 8, Unit 15
-
Lesson 8, Unit 16
-
Lesson 9, Unit 17
-
Lesson 9,
Unit 18
-
Lesson 10, Unit 19
-
Lesson 10, Unit 20
-
Lesson 10, Unit
21
-
Lesson 11, Unit 22
-
Lesson 12, Unit 23
-
Lesson 12, Unit 24
Answers
- A program is a list of instructions that tells the computer exactly what to do.
- Absolutely nothing. A computer is a dumb machine that cannot function without the detailed instructions of a program.
- You can buy a
program or write one yourself.
- The programs that you write do exactly what you want them to do once you get any bugs out of them.
- Writing your own programs takes lots of time and effort.
- True
- Code is a program.
- An error that you accidentally place in the programs that you write.
- There are syntax errors and logic errors.
- You've just put a syntax error in the program.
- Visual Basic finds syntax errors for you.
- Logic errors are much harder to find than syntax errors.
- With hardwired control panels.
- Non-electrical people could program computers.
- On and off states of electricity.
- The addition of the computer keyboard
introduced programming to the masses.
- Code is the program that you and other programmers create.
- Machine language
- FORTRAN
- BASIC
- Beginner's All-purpose Symbolic Instruction Code
- Procedural
programming languages lend themselves well to text-based DOS environments.
- Event-driven programs lend themselves well to Windows-like environments.
- Graphical User Interface
- Two events might be a keypress or a mouse click.
- The user might trigger any event in any order.
- False. Visual Basic does require some procedural-like programming for certain functions.
- True
- True
- True
- Add a shortcut Ctrl + Shift + V keystroke using the File Properties menu after highlighting the Visual Basic icon
in the program group.
- False
- Select File Run, then type A:\SETUP (You can type the command in uppercase or lowercase letters).
- The value used if you don't type a different value.
- VBPRIMER
- Select File
Exit to exit Visual Basic and return to Windows.
- You may lose some or all of the program you're writing.
- The Code window, Form window, Project window, Properties window, and the Toolbox window.
- Visual Basic uses the Form
window for the application's background.
- False
- True. Click on the dialog control box's upper-left corner.
- Use the access keys to more quickly execute menu commands.
- The toolbar provides push button access to
common menu commands.
- The Visual Basic menu bar follows the same naming standard for most of its menu commands as other major Windows programs use.
- Eleven
- Not all menu or toolbar commands are available at all times.
- The measurement indicators describe the size and location of elements on the Form window.
- A twip is 1/1440th of an inch.
- The grid provides snap-to locations that keep controls in alignment with the grid's dots when you set the
appropriate Options Environment command.
- You must first load the
application using File Open.
- The project file holds the application's description.
- .MAK
- Load the project and look in the Project window.
- To let the user interact with and direct the program. Users click, scroll,
and manage the controls as a way to respond to a program's activities.
- The Toolbox window holds the controls that you can add to your form. (Don't you think "Control window" would be a better name?)
- The user needs an easy
way to exit a program.
- False. The user cannot directly change text displayed in a label control.
- The text box control.
- You can control the font size and style of the text.
- The user can move the text cursor
forward and backward in a text box as well as use the Ins and Del keys to insert and delete text.
- The command button control
- False
- True
- The user deselects a check box by selecting the box a second time.
- The frame control
- True
- True
- False
- True
- The form works as the application's background and holds the controls that you place there.
- True
- The user can click the command button
with the mouse or press the Alt+ shortcut access keystroke if the command button's label contains an underlined character. There is a third way as well (not documented in this unit): The user can press Tab until
the command button is highlighted and press
Enter.
- The command button next to the combo box informs Visual Basic that there is data to be added to the list.
- Pamela should replace the simple combo box with a dropdown combo box control.
- An event might be a user keypress, mouse movement, mouse click, menu selection, or virtually anything else that
a user can do to respond to a program.
- There are too many ways for the user to interact with the visual controls on the screen. A text-based program dictates the order of the user's involvement.
- False. Sometimes Windows captures
events for its own system use.
- Properties are attributes that differentiate the actions and behaviors of controls.
- Event procedures
- Here are four properties (from a huge list of many others): font size, font style, the
control size, and the control color
- True
- True
- The Properties window
- The process of updating the program later.
- The three-letter prefix describes what kind of control you're working with.
- Users will more speedily adapt to your programs when they follow Windows standards.
- AUTOLOAD.MAK
- CONSTANT.TXT
- Names given to data values that make them easier to remember.
- False
- Double-click the
control on the Form window.
- The first part of the event procedure is the control name, followed by an underscore, followed by the name of the event (and parentheses come after that to let you know you're working with a procedure name and not a
control name).
- Wrapper code
- End
- The controls and form names inside the project.
- Usually the project and form names are the same with a .MAK and a .FRM extension respectively.
- A form
- A combo
box
- A command button
- Victor, less is better! Use fewer fonts or you'll confuse the user looking at your screen.
- A. End is a reserved word.
B. Names cannot begin with a number.
C. Names cannot contain special
characters such as a dollar sign.
D. Names cannot contain hyphens.
- The control that has Windows current attention. You can tell which one it is by the highlighting.
- The order in which the controls receive the focus as the user presses the Tab key.
- TabIndex
- The Name property.
- False
- True
- CONSTANT.TXT
- An icon is a picture.
- A point is 1/72nd of an inch.
- A selection of colors from which you can choose.
- D. All of the above.
- Enabled.
- 0,
1, or 2 representing left-justified, centered, or right-justified.
- False; rarely will you have to set or change more than a few properties because the default values are so common for many of the properties.
- A carriage return
character sends the text cursor to the next line on the screen.
- Dynamic Data Exchange.
- True due to the Visible property.
- Left, Right, Top, Width.
- The label control.
- The PasswordChar property.
- The Cancel property.
- Use the control dropdown selection box.
- Yes, the form is an object as is the other controls.
- False, label controls have no MultiLine property.
- A pixel is the smallest screen element available.
- The WindowState property.
- Chopping
off part of text.
- False
- False, text box controls can have scroll bars.
- Set the AutoSize property to False.
- False.
- False.
- The TabIndex property controls the focus order.
- The Load
event.
- The Load event occurs before the Activate event occurs.
- The Code window contains a Proc dropdown list box that contains all the events for any given object.
- Labels can never receive the focus.
- The name of
the event procedure must be txtLastName_Change().
- The KeyPreview property determines whether the form or control gets the keystrokes.
- The Caption property.
- Add the access key to a label that describes the text box contents.
Make sure that the TabIndex of the label is sequentially one less than the TabIndex of the text box.
- The labels could hide too many other form objects.
- The label would automatically expand horizontally before you have a chance to set
the WordWrap property.
- A named storage location in memory.
- The Dim statement.
- A data type is a category of data that all Visual Basic values fall into.
- Integer, Long, Single, Double, Currency, Variant, String
- Integer
- Double
- Single, Double, and Currency
- E means Exponent.
- Scientific notation provides a shortcut notation for a wide range of numeric values.
- False
- True; variables can change but they do not have to.
- You'll help eliminate bugs that can occur
when you misspell a variable name.
- A fixed-length string can only accept a preset number of characters while variable-length strings can accept strings of changing-length as a program runs.
- True
- True
- A. 7
B.
9
C. 16
D. (parentheses would be required around the addition to compute a true average)
E. 6
F. 40
- Merge the strings together
- + is used for either addition or string concatenation (depending on the context of its
use) and & is used strictly for concatenation.
- Dim SqFoot As Single
- SalesPrice = Price / Discount
Tax = TaxRate * SalesPrice
- Name is a reserved word and cannot be a variable name.
- Judy cannot define more
than one variable with the same name. There is an advanced exception to this rule that you'll learn in Lesson 7.
- Larry cannot use a dollar sign or commas in constant values.
- A condition is a relation that you can check for in your program.
- False, conditional tests produce one of two results, true and
false
- False but the parentheses help clarify the code
- <, >, <=, >=, =, <>
- A. False
B. True
C. True
D. True
E. True
F. False
- The ASCII table
- The If statement
makes decisions (as well as the Select Case)
- The If-Else statement
- False
- A nested If is an If statement within another If statement
- The Select Case
- Four: Case value, Case Is, Case To, and Case Else
- Nothing happens and control falls to the statement following the End Select statement
- The code in the Case Else executes before control returns to the statement following the End Select statement
- Case To
- Case Is
- If (M = 3) AND (P = 4) Then
TestIt = "Yes"
End If
- If (d >= 3) Or (p < 9) Then
- Select Case Age
Case Is <0: lblTitle.Text = "Age Error"
Case Is <5: lblTitle.Text =
"Too young"
Case 5: lblTitle.Text = "Kindergarten"
Case 6 To 11: lblTitle.Text = "Elementary"
lblSchool.Text = "Lincoln"
Case 12 To 15: lblTitle.Text = "Intermediate"
lblSchool.Text = "Washington"
Case 16 To 18: lblTitle.Text = "High School"
lblSchool.Text = "Betsy Ross"
Case Else: lblTitle.Text = "College"
lblSchool.Text = "University"
End
Select
- There is no End Else statement.
- A comment that
helps explain a program's logic.
- To help aid programmers with program maintenance.
- False
- True
- Two: The Rem statement and the apostrophe remark
- To state the programmer's name and the date the program
was written
To describe in the (general) procedure the overall goal of the program
To describe at the top of all procedures the overall goal of that procedure
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
- Programmers
- False; add remarks when you write your program so you'll be able to understand the program more easily when you modify it later.
- False
- Specify a type value that signifies which group of command buttons you need.
- By specifying a msg value.
- Modal indicates whether or not the user must respond to a message box before switching to another
application.
- True
- False
- To get answers
- Strings and variants
- Check for a null string, "", to see if the user pressed Cancel or OK.
- Press the OK command button (or press Enter which
clicks the OK command button)
- Four
- None
- Use a proper type value
- Seven
- Seven
- Make sure that the type argument includes the value of 4096 or the MB_SYSTEMMODAL named constant.
- 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:
- do until (endOfFile) ' Continue until the end
- A loop is the repetition of a block of Visual Basic statements.
- Five
- Four
- True
- A loop that
repeats forever (at least until the user intervenes to stop the loop)
- Keep asking the user for the answer, using a loop, until the user enters a correct response.
- 9
- 10
- 0
- 10
- 1
- The
For statement
- The Do statement
- 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.
- 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.
- An iteration is one complete loop cycle.
- Use a negative Step value.
- The increment's Step value must be negative.
- The Exit Do and the Exit For statements end loops before their natural termination.
- Dim Guess, Ans As Integer
Guess = 34 ' The user must guess this
Do
Ans =
InputBox("Make a guess...", "Guessing Game")
' Tell the user about the wrong guess
If (Ans <> Guess) Then
MsgBox "You guessed incorrectly. Try again."
End If
Loop While Ans <> Guess
- Larry changes the variable named i inside the loop, keeping the For loop's controlling variable from ever triggering the end of the loop.
- Kim must switch the starting and ending values like this:
For I = 1 To 100 Step 1
- Arrays let you step through large amounts of data without the need to
reference multiple variable names.
- A single item from the array's list of values
- The array subscript is the number that references different array elements.
- One
- 20
- True
- Use the subscript
- The Static statement defines arrays
- 1
- The For loop works best for array processing.
- List and combo boxes
- False
- True as long as the MultiSelect property is set to True.
- True
- The methods initialize, count, and remove items from list and combo box controls.
- The AddItem method
- True
- False
- True
- True
- The Selected method
- False
- The Sorted
property
- Static StdAges(3) As Integer
- The MultiSelect property
- Sub cmdGoAway_Click()
lstVals.Clear
End Sub
- The command button can trigger an event procedure that uses the AddItem method to add the new
item to the combo box.
- 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.
- The option button
- The check box
- Option buttons imitate older radios with push button station
selectors.
- The first option button will no longer be selected.
- True
- The Alignment property determines if the option or check box description appears to the right or left of the button or check box.
- The Value
property
- The Value property
- False
- True
- A holder of other controls such as option buttons.
- False
- A special character that performs an action on the screen.
- Concatenate a
combination of carriage-return/line feed character strings within text to break the lines onto separate label lines.
- Changes a number to its ASCII character equivalent.
- An array of controls that are the same control type.
- All arrays, including control arrays, have only one name.
- By a subscript
- Zero
- One
- Index
- By displaying a message box that makes sure you want to create a control array.
- cmdAll_DblClick
(Index As Integer)
- Opal needs to draw her application's option buttons within their frames, not move them into the frames.
- An argument is a value that you pass to a function inside the function's parentheses.
- False
- True
- False
- There are three different integer
functions because there are different ways to round numbers.
- A. 61
B. -62
C. -61
D. 422
- False; CInt() is a true rounding function whereas Int() and Fix() always round positive arguments down to the integer equal
to or lower than the argument.
- The Asc() function is the mirror-image function to Chr$().
- A. "ABCDEFG"
B. "abcdefg"
- Anything would hold the string "78.1"
- A. S
B. Sam
C.
D. ams
E. ams
- True, see question #18 and #19.
- True
- Str$() (or Str())
- Pass the numeric value to Str$() before concatenating the value to the prompting string.
- Send to
Len() a double-precision variable and multiply the result by 250.
- Dim ANum, ANumSq As Single
ANum = Val(InputBox$("Enter a number to square"))
MsgBox "The square of your number is" & Str$(Sqr(ANum))
- First = InputBox$("What is your first name?")
Last = InputBox$("What is your last name?")
MsgBox "Your name has" & Str$(Len(First) + Len(Last)) & "letters"
- ValAsc = Asc("P")
- Rudy needs to convert the weight value to a long integer because he is computing a value too large for an integer result.
- True
- The time and date functions get their values from your computer's internal clock and calendar.
- 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.
- True
- False
- 19:54
- Date$() returns a string and Date() returns a variant data type.
- False; Visual Basic supports only a Now() function.
- Now()
returns a value based on the 12-hour clock.
- False
- False; Date and Time (statements not functions) set your computer's date and time.
- Date$()
- Timer() returns the number of seconds since midnight as a
double-precision value.
- A byte is a character of memory.
- The VarType 7 data type
- 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.
- A logical value is the result of a relational comparison.
- Format() and Format$()
- Format() returns a variant data type and Format$() returns a string.
- 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.
- The "Fixed" fixed-format string does not enclose negative values in
parentheses and does not display a thousands separator in large numbers.
- 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.
- Technically, the answer is false. We're splitting hairs, however. An event
procedure is a specialized form of a subroutine procedure.
- Use the Call statement to call subroutine procedures.
- Use the function procedure's name inside an expression or statement.
- You can select from the View menu bar
command or type Sub or Function below another procedure in the Code window.
- If a dollar sign appears after the function name, the function returns a string.
- A function procedure returns a value back to the calling procedure.
- Assign the function's return value to the function name as if the function name were a variable.
- F2
- The programmer must supply the code for function procedures.
- Module
- .BAS
- You do not yet know how
to pass data between procedures.
- Option Base and Option Explicit
- True
- True
- Sub PrReport()
End
- Function GetValue()
End Function
- GetPi = 3.14159
- There are no
parentheses around the argument list so you cannot use the Call keyword.
- Local
- Module
- Global
- False
- True
- True
- Global
- Module
- As global constants
- Defined global named constants
- Nowhere else in the program
are you allowed to assign values to constants.
- In the (general) procedure of a non-form module.
- 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.
- The values in local variables go away when the procedure ends.
- The sending procedure
- The receiving procedure
- False
- 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.
- False
- False; you can pass several arguments to a function procedure but return only one value.
- Two
- Passed data may be changed by the receiving procedure and those changes remain in effect when the sending procedure regains control.
- Passed data cannot be changed by the receiving procedure except within the boundaries
of the receiving procedure.
- Use the ByVal keyword or enclose passed arguments in parentheses.
- The UBound() function
- Global LastName As String
Global Age As Integer
- Global Const NDAYS = 7
Global Const
NMONTHS = 12
- A. You must initialize a constant and constants cannot have data type declarations.
B. Constants cannot have data type declarations.
C. Always define constants using the Const keyword.
D. You cannot initialize a
global variable at the time that you define the variable.
- 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.
- File data
- 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.
- A set of controls that get user information.
- 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.
- Set the frame's Visible property to True or False.
- Three
- At runtime
- A
pattern, using the * and ? filename wildcard characters, that determine which files are to be displayed in the file list box.
- When one file control changes, that change usually affects other file controls.
- 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.
- The directory and the filename list box controls.
- The filename list box control is the only control that needs to be updated
when the user changes the directory list box.
- The DidCancel variable contains either True or False.
- The Change event.
- True
- Both ACCT* and ACCT*.* work.
- Both *.ex? and *.ex* work.
- drvDisk.Drive = "d:"
dirList.Path = "d:\vbprimer\direng" ' Root directory
- A collection of related data, programs, or a document.
- To hold long-term data.
- True as long as the files reside in separate directories or disks.
- Open
- Input,
Output, and Append
- the file number associates a file with a number.
- Visual Basic creates the file.
- Visual Basic overwrites the file.
- Visual Basic creates the file.
- Visual Basic adds to the end of the
file.
- Visual Basic displays an error.
- 1 to 255
- False
- FILES=
- FreeFile()
- Close
- Close ensures that the file is safely stored away in case a power failure occurs.
- The
statement closes all open files.
- Write#
- A comma
- A pound sign
- A quotation mark
- Input#
- A line from a file
- The Eof() function tests for the end of file.
- Line Input#
- "Peach", 34.54, 1, "98"
- Rusty must use the following Line Input# command:
Line Input #1, MyRecord
- Close 3, 19
- Open "names.dat" for Append As #7
- Sub ReadData ()
' Reads
array data from a file and reports the data
' Assume that 200 values were read
Static CNames(200) As String, CBalc(200) As Currency
Static CDate(200) As Variant, CRegion(200) As Integer
Dim NumVals As Integer ' Count of records
Dim ctr As Integer ' For loop control
NumVals = 1 ' Start the count
' Reads the file records assuming
' four values on each line
Open "c:\mktg.dat" For Input As #1
Input #1, CNames(NumVals), CBalc(NumVals),
CDate(NumVals), CRegion(NumVals)
Do Until (Eof(1) = True)
NumVals = NumVals + 1 ' Increment counter
If (NumVals = 201) Then
MsgBox "First 200 values are now read", MB_ICONEXCLAMATION
Exit Do
End If
Input
#1, CNames(NumVals), CBalc(NumVals), CDate(NumVals), CRegion(NumVals)
Loop
' When loop ends, NumVals holds one too many
NumVals = NumVals - 1
' The following loop is for reporting the data
For ctr = 1 To NumVals
' Code goes here that outputs the array
' data to the printer
'
Next ctr
Close #1
End Sub
- The Menu Design window designs menus.
- True
- False
- True
- mnu
- A pull-down menu that appears when you click a menu bar item.
- The up and down arrow command buttons let you rearrange menu options.
- The left and right arrow command buttons let you indent or remove indentions that indicate submenu items.
- Checked
- Visible
- True
- A single hyphen
- Click
- Chr$(8) (the backspace character) right-justifies menu bar items.
- True
- Frank needs to concatenate the Chr$(8) at runtime in the Form_Load() procedure.
- mnuWindowSplit
- mnuViewBar1 and mnuViewBar2
- Select the Enabled property to gray out certain menu items.
- The Timer control
- The Interval property
- The user does not see the timer control on the running program's form.
- Nothing.
- False; the timer control triggers its own
events.
- Milliseconds
- False
- One thousandth of a second
- Ten seconds
- One minute
- tmr
- The Interval property can hold values larger than integers can hold.
- Timer()
- False; you can only trigger a timer event to occur repeatedly
- The Windows environment can sometimes cause a Visual Basic application to skip a time interval
- 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.
- Print
- The Windows Print Manager collects all printing and routes the output to the appropriate printer.
- The Windows Print Manager recognizes all installed printers
so that individual programs do not have to.
- Online means that the printer is ready and has paper.
- Issue a message box that warns the user of subsequent output.
- The Printer object is a generic Visual Basic object that
collects all printed output and sends that output to the Windows Print Manager.
- True
- The smallest point on a printer or screen.
- The Print method
- False
- False
- The positive numbers each contain
a hidden plus sign that does not print.
- A zone is a kind of built-in tab stop that occurs every 14 columns of printed output.
- True
- Use Chr$(34)
- True
- The distance between the bottoms of the characters
on one line to the bottoms of the characters on the line above.
- 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.
- The second Print slips 10 spaces before printing, whereas the first Print begins printing in column 10.
- Line1Line2
- The Spanish N is ñ.
- Printer.Print Tab(57); "America"
- The line and shape controls let you draw geometric shapes on a form.
- Six
- BorderStyle
- The Shape property
- The picture box control and the image control
- The image control is more efficient than the picture box control.
- Bitmaps, metafiles, and icons.
- The Shrink property
- The Picture property
- LoadPicture()
- Jean cannot change the line appearance for any line thicker than one twip.
- Jean would have to draw several smaller thick lines to create the appearance of a single dashed line.
- Nothing appears when the LoadPicture() function executes because of the null argument.
- Indicate the blue border using the BorderColor property, the red diagonal line using the FillColor property, and the green interior with the
BackColor property.
Lesson 12, Unit 23
- 2
- The user can select from the scroll bar's relative
position instead of typing specific values.
- The amount that the scroll bar values change when the user adjusts a scroll bar's value.
- By clicking within the shaft on either side of the scroll bar.
- The smallest and largest
values that a scroll bar can represent.
- hsb and vsb are the preferred naming prefixes.
- True
- Make sure that the grid's custom control file is added to the project.
- GRID.VBX
- False
- One of the
individual row and column intersection locations inside a grid.
- False
- When the grid's size is not large enough to display the full grid.
- Row and Col
- SelEndCol, SelEndRow, SelStartCol, and SelEndCol
- 12
- MousePointer
- The caret
- The cursor
- When a control's default MousePointer property is not the arrow. This typically occurs only for custom controls.
- The hourglass
- Through event procedure
arguments
- True
- 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.
- Min: 32, Max: 212, SmallChange: 3, LargeChange: 8
Lesson 12, Unit 24
- Logic and syntax errors
- Syntax error
- A debugger is an online tool that lets you hunt down errors (bugs) in a program.
- Use the Options Environment command to request interactive syntax checking.
- True
- False
- Syntax errors are easier than logic errors to find.
- Design mode, run mode, and break mode
- Design mode
- Look at Visual Basic's title bar to see the name of the current mode.
- Break mode
- Press Ctrl+Break, Select from the Run menu, click the break button on the toolbar, or set a breakpoint
- A specific line that Visual Basic halts execution at during a program's run.
- By highlighting the line of code and pressing F9,
clicking on the toolbar, or by selecting from the Debug menu
- Visual Basic highlights the breakpoint line
- When Visual Basic reaches a breakpoint, Visual Basic halts the program's run before the breakpoint line executes.
- Executing a program one line at a time, controllable by yourself instead of by Visual Basic.
- 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.
- 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.
- The Instant Watch is most handy for looking at variables during a breakpoint.
- The Debug window
- The
Print method
- The assignment statement
- Jennifer must precede her Print methods with the Debug object.