Errata: Second Printing
The following is a listing of various errors found in the text for the second printing. Errors in previous printings are found in a list following this one. Errors in older lists may have been corrected in newer printings. If you have found an error in your copy that you do not find in this list, please notify the author through the feedback page.
Chapter 3: All VB Code boxes and references to VB Code Boxes are incorrect. All VB Code Boxes are numbered as 7- and referred to in the same way. All references match, but the they should be numbered as VB Code Box 3- instead of VB Code Box 7-.
Page 154: In the next to last line of Exercise 6, “text” should be “test”.
Page 232: In VB Code Box 6-7. The statement immediately before the End Sub statement is now:
FileClose()
It should be
srdReadFile.Close()
Page 232:
·  · In VB Code Box 6-7, the statement:
Dim intNumPrices As Integer = 0
should be
intNumPrices = 0
Otherwise, it declares intNumPrices as a local variable. Note the complete program shown in VB Code box 6-12 is correct.
·  · In VB Code Box 6-7, two lines of code are missing in the form_load procedure. These lines of code are:
strPartID(intNumPrices) = strFields(0)
decPrices(intNumPrices) = CDec(strFields(1))
These additional lines of code come immediately prior to the statement that increments intNumPrices, that is, intNumPrices = intNumPrices + 1
Note the complete program shown in VB Code box 6-12 is correct since it includes these code statements.
Page 237: In VB Code Box 6-11 The statement immediately before the End Sub statement is now:
FileClose()
It should be
srdReadFile.Close()
Page 245: In VB Code Box 6-14. The statement immediately before the End Sub statement is now:
FileClose()
It should be
srdReadFile.Close()
Page 250: In VB Code Box 6-18. The statement immediately before the End Sub statement is now:
FileClose()
It should be
srdReadFile.Close()
Page 266: In Exercise 6-7. The next to the last line should refer to “customers” rather than “salespeople.”
Page 278:
·  · Midway down the page, the Function definition statement should be:
Function decSum(ByVal decValues() as Decimal) As Decimal
There should be no reference to the intNumValues parameter in the function declaration statement.
·  · At the bottom of the page, the function reference statement should be:
txtSum.text = decSum(decPrices)
There should be no reference to the intNumValues parameter in the function reference statement.
Page 279: The fourth line of VB Code Box 7-2
It should be
decAverage = decSum(decValues) / intNumvalues
There should be no reference to the intNumValues parameter in the decSum function and the divisor should be “intNumValues” instead of “intNumPrices”
Pages 325-326: To save the data to that is added on the third form for Projects 6, 7, and 8 to the text file, it is best to use
Printline(n, variable1 & chr(9) & variable2)
instead of Writeline
Page 342: In VB Code Box 8-8
·  · Both references to “udtEmployees(intCounter)” in lines 10 and 13 should be to “udtEmployees(intEmpCntr)”, that is, line 10 should be
ReDim Preserve udtEmployees(intEmpCntr)
·  · Line 13 should be
With udtEmployees(intEmpCntr)
There should also be a statement to close the StringReader operation at the end of the procedure, that is, add the following statement immediately before the end of the procedure:
srdEmployee.Close
·  · The indices in Lines 16 and 17 should be changed as follows:
.strSSNum = strFields(3)
.strPhone = strFields(2)
This last error causes the bottom portion of Figure 8-7 to be incorrect in that it shows one telephone number and two SS numbers under the heading “Telephone #”
Page 370: For the discussion in this section, the txtHrsWrked text box on the frmShowEmp form must be renamed as txtHrsWorked
Page 399, Exercise 6:
·  · In addition to renaming the Vintage7 application, you should remove the lstTypes list box and the associated label so your Vintage main form appears as shown in Figure 9-4 at the top.
·  · In addition, the vintage.mdb data base should be downloaded to the c:\vbdb folder instead of to the bin folder of the new Vintage9 folder.
Errata: First Printing
The following is a listing of various errors found in the text for the first printing. The lists are categorized based on the printing with the most recent printing first. Errors in older lists may have been corrected in newer printings. If you have found an error in your copy that you do not find in this list, please notify the author through the feedback page.
1st Printing - Learning to Program with Visual Basic .NET .
All errors listed here have been corrected in the second printing.
Page 32, First sentence in paragraph with heading the Properties Window:
The reference to the “Project Explorer window” should be to the “Solution Explorer window” .
Page 108, Projects 6, 7, and 8:
Some of the text is run together. You may download revised pdf files for these pages by clicking here.
Page 144, VB Code Box 4-11:
Insert the following line of code in the btnClear event procedure immediately prior to the txtCustName.focus() statement to clear the selected item in the listbox:
lstTypes.ClearSelected
Page 191, immediately before the “Removing names from the membership list” heading:
Insert the following line of code to clear the selected item in the listbox by setting its selected index to -1:
lstTypes.SelectedIndex = -1
Page 215, TIP:
Replace “Subscript out of range” with “System.IndexOutofRangeException” . (This is VB .NET’s way of saying the index is out of range.)
Page 217, in the line of code in middle of page:
Change “cdec” to “CDec” .
Page 218, fifth line from top of page:
The statement: “Input n, ArrayName(intCounter)” should be
“Input(Input n, Arrayname(intCounter))” since Input is now a function in VB .NET.
Page 219, VB Code Box 6-1:
“IntNumPrices = 0” should be “intNumPrices = 0” (lower case initial letter in variable name)
Page 219, VB Code Box 6-4:
“If IntCounter > 0 Then” should be “If intCounter > 0 Then” (lower case initial letter in variable name)
Page 231, line of code beneath first complete paragraph:
The declaration should be:
Dim srdReaderFile as System.IO.StreamReader = _
New System.IO.StreamReader(strFileName)
Where the “New” was left out and the “System” and “IO” were reversed in two places.
Page 239, Step-by-Step Instructions 6-3, number 3:
The “s” in “String” should be uppercase.
Page 271, Figure 7-2:
The label above the top part of the figure should read “Sub procedure” instead of just “procedure.”
Page 297, Tip:
The keyboard shortcut for the paste operation is Ctrl-V and not Ctrl-P is as given in this tip.
Page 307, Table 7-3:
There should be a closing parenthesis at the end of strVariable.IndexOf(substring)
Page 352, It’s Your Turn, number 3:
“What properties …” should be “What methods …”
Page 358, Figure 8-11:
The left-most label above the figure should be “Employee Class” and not “Employee Object”; “Employee Object” is correct for the second label.
Page 364, next to the last line of first paragraph:
“Sub LoadFile” should be “Sub FileLoad”
Page 364, VB Code Box 8-19:
“Sub LoadFile” should be “Sub FileLoad” (in the first line of the sub).
Also “MPriceArray.Add(decPrice)” should be “mPriceArray.Add(decPrice)” (lower case first letter)
Page 385, in Projects 1-5:
All references to “direct access file” should be to a “sequential access file.” You may download corrected pages 385 – 392 by clicking here.
Page 385, in project number 1:
The Student.txt file can be downloaded from the Chapter 8 (not section of the Web site, not the Chapter 12 section.
Also, all fields for this exercise except the QuizAverage field should be String data type. The QuizAverage field should be an Integer data type.
You should create a user-defined data type with an appropriate name in a module named Structure.vb to match these fields and declare an array of this type in the same module. The contents of the data file will be input into this array.
Page 386, in project number 2:
All fields for this exercise except the SalesAmount field should be String data type. The SalesAmount field should be a Decimal data type.
You should create a user-defined data type with an appropriate name in a module named structure.vb to match these fields and declare an array of this type in the same module. The contents of the data file will be input into this array.
Page 387, in project number 3:
The fields and data types for this problem are shown below:
Field / Type
AgentName / String
SSNumber / String
WHPercent / Single
YTDSales / Decimal
YTDWH / Decimal
You should create a user-defined data type with an appropriate name in a module named Structure.vb to match these fields and declare an array of this type in the same module. The contents of the data file will be input into this array.
Page 387, in project number 4:
The fields and data types for this problem are shown below:
Field / Type
CustomerName / String
Discount Rate / Single
YTD Gross / Decimal
YTD Net / Decimal
You should create a user-defined data type with an appropriate name in a module named Structure.vb to match these fields and declare an array of this type in the same module. The contents of the data file will be input into this array.
Page 388, in project number 5:
The fields and data types for this problem are shown below:
Field / Type
SKU / String
Combo Name / String
Combo Price / Decimal
Number Sold / Integer
You should create a user-defined data type with an appropriate name in a module named Structure.vb to match these fields and declare an array of this type in the same module. The contents of the data file will be input into this array.
Page 389, in project number 6:
Ignore the second paragraph of this exercise.
Page 391, in project number 14 is the same as Project 13 and should be ignored.
Page 410, two lines from end of first paragraph:
Change “find the first record in the Members table…” to “find all records in the Members table…”
Pages 416-418:
There are some bad breaks on these pages and you may download corrected pages by clicking here.
Page 422, first line below VB Code Box 9-10:
The reference to VB Code Box 9-9 should be to VB Code Box 9-10.
Page 451, in project number 11, two lines from the bottom:
Change “text boxes” to “datagrid”.
Page 474, Add a new Step 4 and renumber subsequent steps:
4. Add a blank label in the bottom left-hand corner of the form that is approximately one-fourth the width of the form. Give it a name of lblNumberofEmployees. We will use this label to display the number of employee records in the list box.
Page 475, in the It’s Your Turn exercises:
There are two number 4’s; renumber the last two exercises to be 5 and 6.
Page 477, last line of next-to-last paragraph (right the “Error checking” section
Add to the end of the line: “and assigned an initial value of “Temp” .
Page 478, last line in the third paragraph (right before the “Imports” statement:
Add to the end of the line: “before the Public Class form_name statement:”
Page 479, at end of first paragraph:
Add the following to the end of the last sentence: “including calling it from mnuFileSaveAs to save a new file.”
Page 479, in VB Code Box 10-10:
In the third line, “Datailes” should be “Data Files”
Also, in the Msgbox function, there should be a second comma between the two string constants.
Page 482, in VB Code Box 10-12:
In the fourth line there should be a comma between intCurrent and intNumEmp.
Also, all references to the “Spacer function”, should be to the “strSpacer function.” These occur in lines 21-23.
Page 483, Step-by-Step Instructions 10-4:
·  At the end of Instruction number 3, add: “Also, add two dialog controls which should be named dlgOpen and dlgSave.”
·  Replace Instruction number 4 with: “Create a sub procedure named SaveAs using the code shown in VB Code Box 10-10. Double-click the mnuFileSaveAs menu option and add a single line of code to reference the SaveAs sub procedure. “
·  In Instruction number 6, change the reference to VB Code Box 10-11 to be VB Code Box 10-12.
Page 484, “It’s Your Turn” exercises:
In Exercise 6, you need to create Social Security numbers and phone numbers for the three people you are adding to the list box.
Page 485, three lines from the bottom of the page as the end of the line:
Change “form” to “project”.
Pages 508-12, Projects 1-5:
All of these projects have been extensively redone to match up with the corresponding projects in Chapter 8. The revised pages can be downloaded from here.
Send email to the author with additional errata you may find as well as questions or comments about this web site or the text.
Last modified: November 7, 2003.