100% found this document useful (4 votes)
163 views

Programming with Microsoft Visual Basic 2017 8th Edition Diane Zak 2024 scribd download

Diane

Uploaded by

rainsarceo6y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
163 views

Programming with Microsoft Visual Basic 2017 8th Edition Diane Zak 2024 scribd download

Diane

Uploaded by

rainsarceo6y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Download the Full Version of ebook for Fast Typing at ebookmass.

com

Programming with Microsoft Visual Basic 2017 8th


Edition Diane Zak

https://ebookmass.com/product/programming-with-microsoft-
visual-basic-2017-8th-edition-diane-zak/

OR CLICK BUTTON

DOWNLOAD NOW

Download More ebook Instantly Today - Get Yours Now at ebookmass.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Clearly Visual Basic: Programming with Microsoft Visual


Basic 2010, Second Edition Diane Zak

https://ebookmass.com/product/clearly-visual-basic-programming-with-
microsoft-visual-basic-2010-second-edition-diane-zak/

ebookmass.com

Starting Out with Visual Basic - 8th Edition Tony Gaddis

https://ebookmass.com/product/starting-out-with-visual-basic-8th-
edition-tony-gaddis/

ebookmass.com

Microsoft Visual Basic 2017 for Windows, Web, and Database


Applications: Comprehensive 1st Edition Corinne Hoisington

https://ebookmass.com/product/microsoft-visual-basic-2017-for-windows-
web-and-database-applications-comprehensive-1st-edition-corinne-
hoisington/
ebookmass.com

Financial Analysis with Microsoft Excel 8th Edition


Timothy R. Mayes

https://ebookmass.com/product/financial-analysis-with-microsoft-
excel-8th-edition-timothy-r-mayes/

ebookmass.com
Oracle Database Programming with Visual Basic.NET:
Concepts, Designs and Implementations Ying Bai

https://ebookmass.com/product/oracle-database-programming-with-visual-
basic-net-concepts-designs-and-implementations-ying-bai/

ebookmass.com

Essentials of Modern Business Statistics with Microsoft


Excel 8th Edition David R. Anderson

https://ebookmass.com/product/essentials-of-modern-business-
statistics-with-microsoft-excel-8th-edition-david-r-anderson/

ebookmass.com

Simple and Efficient Programming with C#: Skills to Build


Applications with Visual Studio and .NET 2nd Edition
Vaskaran Sarcar
https://ebookmass.com/product/simple-and-efficient-programming-with-c-
skills-to-build-applications-with-visual-studio-and-net-2nd-edition-
vaskaran-sarcar/
ebookmass.com

Simple and Efficient Programming with C# : Skills to Build


Applications with Visual Studio and .NET 2nd Edition
Vaskaran Sarcar
https://ebookmass.com/product/simple-and-efficient-programming-with-c-
skills-to-build-applications-with-visual-studio-and-net-2nd-edition-
vaskaran-sarcar-2/
ebookmass.com

Microsoft Visual C# Step by Step, 9th Edition John Sharp

https://ebookmass.com/product/microsoft-visual-c-step-by-step-9th-
edition-john-sharp/

ebookmass.com
8th

DIANE ZAK
EDITION

progr a mming w i t h

MICROSOFT ® VISUAL BASIC ® 2017


MICROSOFT
®

progr a mming w i t h
VISUAL BASIC
®

20 17

To register or access your online learning solution or purchase materials


for your course, visit www.cengagebrain.com. 8th
EDITION

DIANE ZAK
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
PROGRAMMING WITH
MICROSOFT® VISUAL BASIC® 2017

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
EIGHTH EDITION

PROGRAMMING
WITH MICROSOFT®
VISUAL BASIC® 2017

DIANE ZAK

Australia • Brazil • Mexico • Singapore • United Kingdom • United States

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Programming with Microsoft® Visual Basic® © 2018 Cengage Learning
2017, Eighth Edition
Diane Zak ALL RIGHTS RESERVED. No part of this work covered by the copyright herein
may be reproduced, transmitted, stored or used in any form or by any means
graphic, electronic, or mechanical, including but not limited to photocopying,
SVP, GM Science, Technology & Math: Balraj S. recording, scanning, digitizing, taping, Web distribution, information
Kalsi networks, or information storage and retrieval systems, except as permitted
under Section 107 or 108 of the 1976 United States Copyright Act, without the
Product Director: Kathleen McMahon
prior written permission of the publisher.
Product Team Manager: Kristin McNary

Associate Content Developer: Brianna Vorce


For product information and technology assistance, contact us at
Associate Product Manager: Kate Mason Cengage Learning Customer & Sales Support, 1-800-354-9706

Senior Director, Development: Julia Caballero For permission to use material from this text or product, submit all
requests online at www.cengage.com/permissions.
Product Assistant: Jake Toth
Further permissions questions can be e-mailed to
Marketing Director: Michele McTighe permissionrequest@cengage.com

Marketing Manager: Stephanie Albracht

Senior Production Director: Wendy Troeger Library of Congress Control Number: 2017940681

Production Director: Patty Stephan Softcover ISBN-13: 978-1-337-10212-4


LLF ISBN: 978-1-337-68573-3
Senior Content Project Manager: Jennifer K.
Feltri-George Cengage
20 Channel Center Street
Art Director: Diana Graham
Boston, MA 02210
Cover image(s): saemilee/DigitalVision Vectors/ USA
Getty Images
Cengage Learning is a leading provider of customized learning solutions
Cover Designer: Lisa Buckley
with employees residing in nearly 40 different countries and sales in more
Unless otherwise noted all screenshots are than 125 countries around the world. Find your local representative at
courtesy of Microsoft Corporation www.cengage.com.

Open Clip art source: OpenClipArt Cengage Learning products are represented in Canada by Nelson Education, Ltd.

Unless otherwise noted, all content is © Cengage.


To learn more about Cengage Learning, visit www.cengage.com

Purchase any of our products at your local college store or at our preferred
online store www.cengagebrain.com

Notice to the Reader


Publisher does not warrant or guarantee any of the products described herein
or perform any independent analysis in connection with any of the product
information contained herein. Publisher does not assume, and expressly disclaims,
any obligation to obtain and include information other than that provided to it by
the manufacturer. The reader is expressly warned to consider and adopt all safety
precautions that might be indicated by the activities described herein and to avoid
all potential hazards. By following the instructions contained herein, the reader
willingly assumes all risks in connection with such instructions. The publisher
makes no representations or warranties of any kind, including but not limited to,
the warranties of fitness for particular purpose or merchantability, nor are any
such representations implied with respect to the material set forth herein, and the
publisher takes no responsibility with respect to such material. The publisher shall
Printed in the United States of America not be liable for any special, consequential, or exemplary damages resulting, in
Print Number: 01 Print Year: 2017 whole or part, from the readers’ use of, or reliance upon, this material.

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
v

Brief Contents

Pref ace . . . . . . . . . . . . . . . . . . . . . . . . . xi v
Read T h is Bef o re You Begi n . . . . . . . . . . . . . . . . xvi i i
CHAP TER 1 An In t ro du ct i o n to V i sual Studi o 2 0 1 7 and V i sual Ba s i c . . . . . 1
CHAP TER 2 Plan n in g Appl i cati ons and Desi gni ng I nter faces . . . . . . . . 49
CHAP TER 3 Co din g w it h Vari abl es, Named Constants, and Cal cul a ti ons . . . 73
CHAP TER 4 T h e Select i o n Structure . . . . . . . . . . . . . . . . . . 119
CHAP TER 5 T h e Repeti t i o n Structure . . . . . . . . . . . . . . . . . 181
CHAP TER 6 Su b an d Funct i on Procedures . . . . . . . . . . . . . . . 237
CHAP TER 7 St r in g M ani pul ati on . . . . . . . . . . . . . . . . . . . . 287
CHAP TER 8 Ar r ays . . . . . . . . . . . . . . . . . . . . . . . . . 341
CHAP TER 9 Sequ en t ial A ccess Fi l es and Menus . . . . . . . . . . . . . 392
CHAP TER 10 Clas s es an d Obj ects . . . . . . . . . . . . . . . . . . . 427
CHAP TER 11 SQL Ser ve r Dat abases . . . . . . . . . . . . . . . . . . 475
CHAP TER 12 Dat abas e Queri es wi th SQL . . . . . . . . . . . . . . . . 529
CHAP TER 13 Web Sit e Appl i cati ons . . . . . . . . . . . . . . . . . . . 565
APPEN DIX A GU I Des ig n Gui del i nes . . . . . . . . . . . . . . . . . . 599
APPEN DIX B Addit io n al To pi cs . . . . . . . . . . . . . . . . . . . . . 604
APPEN DIX C F in din g and Fi x i ng Program Errors . . . . . . . . . . . . . 632
APPEN DIX D V is u al B asi c 2 0 1 7 Cheat Sheet . . . . . . . . . . . . . . 647
APPEN DIX E Cas e Pro je ct s . . . . . . . . . . . . . . . . . . . . . . 667
Index . . . . . . . . . . . . . . . . . . . . . . . . . . 671

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
vi

Contents

Pref ace . . . . . . . . . . . . . . . . . . . . . . . . . xi v
Read T h is B ef o re Yo u Begi n . . . . . . . . . . . . . . . . xv i i i

CHAPTER 1 An In t ro du ct io n t o V i sual Studi o 2 0 1 7 and V i sual Basi c . . . . . 1


F OCUS ON THE CO NC EPTS LESSON . . . . . . . . . . . . . . . . . . 2
F-1 Computer Programming Terminology . . . . . . . . . . . . . . . . . . . . . . 2
F-2 The Programmer’s Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
F-3 The Visual Basic Programming Language . . . . . . . . . . . . . . . . . . . . 3
F-4 The Visual Studio IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
F-5 Assigning Names to Objects . . . . . . . . . . . . . . . . . . . . . . . . . . 7

APPLY THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . . . . 9


A-1 Start and Configure Visual Studio Community 2017 . . . . . . . . . . . . . . . 9
A-2 Create a Windows Forms Application . . . . . . . . . . . . . . . . . . . . . 11
A-3 Manage the Windows in the IDE . . . . . . . . . . . . . . . . . . . . . . . 13
A-4 Change a Form File’s Name . . . . . . . . . . . . . . . . . . . . . . . . . 14
A-5 Change the Properties of a Form . . . . . . . . . . . . . . . . . . . . . . . 15
The Name Property������������������������������������������������������������������������������������������ 17
The Font Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
The MaximizeBox, StartPosition, and Text Properties . . . . . . . . . . . . . . . 17
A-6 Save a Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
A-7 Close and Open a Solution . . . . . . . . . . . . . . . . . . . . . . . . . . 18
A-8 Add a Control to a Form . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
A-9 Use the Format Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
A-10 Lock the Controls on the Form   . . . . . . . . . . . . . . . . . . . . . . . 24
A-11 Start and End an Application . . . . . . . . . . . . . . . . . . . . . . . . 25
A-12 Enter Code and Comments in the Code Editor Window . . . . . . . . . . . . 28
The Me.Close() Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Assignment Statements and Comments . . . . . . . . . . . . . . . . . . . . . 31
A-13 Print an Application’s Code and Interface . . . . . . . . . . . . . . . . . . 32
A-14 Exit Visual Studio and Run an Executable File . . . . . . . . . . . . . . . . 33
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
vii
 

CHAP TER 2 Plan n in g Appl i cati ons and Desi gni ng I nter faces . . . . . . . . 49
FOCUS ON THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . . 50
F-1 Planning a Windows Forms Application . . . . . . . . . . . . . . . . . . . . 50
F-2 Windows Standards for Interfaces . . . . . . . . . . . . . . . . . . . . . . 52
Guidelines for Identifying Labels and Buttons . . . . . . . . . . . . . . . . . . 53
Guidelines for Including Graphics . . . . . . . . . . . . . . . . . . . . . . . . 53
Guidelines for Selecting Fonts . . . . . . . . . . . . . . . . . . . . . . . . . 53
Guidelines for Using Color . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
F-3 Access Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
F-4 Tab Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

APPLY THE C ONCEPTS LESSON . . . . . . . . . . . . . . . . . . . . 58


A-1 Create a Planning Chart for a Windows Forms Application . . . . . . . . . . . 58
A-2 Design an Interface Using the Windows Standards . . . . . . . . . . . . . . . 59
A-3 Add a Label Control to the Form . . . . . . . . . . . . . . . . . . . . . . . 60
A-4 Add a Text Box to the Form . . . . . . . . . . . . . . . . . . . . . . . . . 62
A-5 Set the Tab Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

CHAP TER 3 Co din g w i t h Vari abl es, Named Constants, and Cal cu l a ti ons . . . 73
FOCUS ON THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . . 74
F-1 Pseudocode and Flowcharts . . . . . . . . . . . . . . . . . . . . . . . . . 74
F-2 Main Memory of a Computer . . . . . . . . . . . . . . . . . . . . . . . . . 76
F-3 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Selecting an Appropriate Data Type . . . . . . . . . . . . . . . . . . . . . . 77
Selecting an Appropriate Name . . . . . . . . . . . . . . . . . . . . . . . . 78
Examples of Variable Declaration Statements . . . . . . . . . . . . . . . . . . 79
F-4 TryParse Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
F-5 Arithmetic Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
F-6 Assigning a Value to an Existing Variable . . . . . . . . . . . . . . . . . . . 85
F-7 ToString Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
F-8 Option Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
F-9 Named Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

APPLY THE C ONCEPTS LESSON . . . . . . . . . . . . . . . . . . . . 94


A-1 Determine a Memory Location’s Scope and Lifetime . . . . . . . . . . . . . . 94
A-2 Use Procedure-Level Variables . . . . . . . . . . . . . . . . . . . . . . . . 95
A-3 Use Procedure-Level Named Constants . . . . . . . . . . . . . . . . . . . . 97
A-4 Use a Class-Level Variable . . . . . . . . . . . . . . . . . . . . . . . . . . 98
A-5 Use a Static Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
A-6 Use a Class-Level Named Constant . . . . . . . . . . . . . . . . . . . . . .103
A-7 Professionalize Your Application’s Interface . . . . . . . . . . . . . . . . . .104
Coding the TextChanged Event Procedure . . . . . . . . . . . . . . . . . . . .104
Coding the Enter Event Procedure . . . . . . . . . . . . . . . . . . . . . . .105

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
viii
C ontents 

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112

CHAPTER 4 T h e Select io n St ruct ure . . . . . . . . . . . . . . . . . . 119


F OCUS ON THE CONC EPTS LESSON . . . . . . . . . . . . . . . . . 120
F-1 Selection Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
F-2 If…Then…Else Statement . . . . . . . . . . . . . . . . . . . . . . . . . .122
F-3 Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Comparison Operator Example: Total Due Application . . . . . . . . . . . . . . 124
Comparison Operator Example: Net Income/Loss Application . . . . . . . . . . .125
F-4 Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128
Logical Operator Example: Gross Pay Calculator Application . . . . . . . . . . .131
F-5 Summary of Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
F-6 String Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135
String Comparison Example: Shipping Application . . . . . . . . . . . . . . . .137
F-7 Nested Selection Structures . . . . . . . . . . . . . . . . . . . . . . . . .139
F-8 Multiple-Alternative Selection Structures . . . . . . . . . . . . . . . . . . . 143
F-9 Select Case Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Specifying a Range of Values in a Case Clause . . . . . . . . . . . . . . . . . 147

APPLY THE CONCE PTS LESSON . . . . . . . . . . . . . . . . . . . 151


A-1 Add a Check Box to a Form . . . . . . . . . . . . . . . . . . . . . . . . .151
A-2 Code an Interface That Contains Check Boxes . . . . . . . . . . . . . . . . .151
CheckBox’s CheckedChanged Event . . . . . . . . . . . . . . . . . . . . . . 153
A-3 Add a Radio Button to a Form . . . . . . . . . . . . . . . . . . . . . . . .154
A-4 Code an Interface That Contains Radio Buttons . . . . . . . . . . . . . . . .154
RadioButton’s CheckedChanged Event . . . . . . . . . . . . . . . . . . . . . 156
Using the Select Case Statement with Radio Buttons . . . . . . . . . . . . . . .157
A-5 Group Objects Using a Group Box Control . . . . . . . . . . . . . . . . . . .157
A-6 Professionalize Your Application’s Interface . . . . . . . . . . . . . . . . . .159
Coding a Text Box’s KeyPress Event Procedure . . . . . . . . . . . . . . . . .159
A-7 Professionalize Your Code Using Arithmetic Assignment Operators . . . . . . . 161
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .165
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172

CHAPTER 5 T h e Repet it io n St ruct ure . . . . . . . . . . . . . . . . . 181


F OCUS ON THE CONC EPTS LESSON . . . . . . . . . . . . . . . . . 182
F-1 Repetition Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . .182
F-2 Do…Loop Statement (Pretest Loop) . . . . . . . . . . . . . . . . . . . . . 184
F-3 String Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . .186
F-4 Infinite Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187
F-5 Do…Loop Statement (Posttest Loop) . . . . . . . . . . . . . . . . . . . . .188
F-6 Counters and Accumulators . . . . . . . . . . . . . . . . . . . . . . . . .190
F-7 For…Next Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . .192
Comparing the For…Next and Do…Loop Statements . . . . . . . . . . . . . . .195
Flowcharting a For…Next Loop . . . . . . . . . . . . . . . . . . . . . . . . 195

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
ix
 

APPLY THE C ONCEPTS LESSON . . . . . . . . . . . . . . . . . . . 197


A-1 Use a Loop, a Counter, and an Accumulator . . . . . . . . . . . . . . . . . .197
A Different Version of the Projected Sales Application . . . . . . . . . . . . . .200
A-2 Add a List Box to a Form . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Using the String Collection Editor to Add Items to a List Box . . . . . . . . . . .203
The Sorted Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
The SelectedItem and SelectedIndex Properties . . . . . . . . . . . . . . . . .204
The SelectedValueChanged and SelectedIndexChanged Events . . . . . . . . . .205
A-3 Use the Methods and a Property of the Items Collection . . . . . . . . . . . .206
Count Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
Clearing the Items from a List Box . . . . . . . . . . . . . . . . . . . . . . .208
A-4 Calculate a Periodic Payment . . . . . . . . . . . . . . . . . . . . . . . . 208
ListBox, Loop, and Financial.Pmt Example: Monthly Payment Application . . . . . .210
A-5 Nest Repetition Structures . . . . . . . . . . . . . . . . . . . . . . . . . .213
Nested Repetition Structure Example: Savings Account Application . . . . . . . .214
A Caution About Real Numbers . . . . . . . . . . . . . . . . . . . . . . . . .216
A-6 Professionalize Your Application’s Interface . . . . . . . . . . . . . . . . . .218
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .228

CHAPTER 6 Su b an d Funct i on Procedures . . . . . . . . . . . . . . . 237


FOCUS ON THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . 238
F-1 Event-Handling Sub Procedures . . . . . . . . . . . . . . . . . . . . . . . 238
F-2 Independent Sub Procedures . . . . . . . . . . . . . . . . . . . . . . . . .240
No Parameters/Arguments Example: History Grade Application . . . . . . . . . .242
F-3 Passing Information to a Procedure . . . . . . . . . . . . . . . . . . . . . .245
Passing Variables by Value Example: Gross Pay Application . . . . . . . . . . . .245
Passing Variables by Reference Example: Concert Tickets Application . . . . . . .248
F-4 Rounding Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . .250
F-5 Function Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252

APPLY THE C ONCEPTS LESSON . . . . . . . . . . . . . . . . . . . 256


A-1 Add a Combo Box to the Form . . . . . . . . . . . . . . . . . . . . . . . .256
A-2 Add Items to a Combo Box and Select a Default Item . . . . . . . . . . . . . 260
A-3 Code a Combo Box’s KeyPress Event Procedure . . . . . . . . . . . . . . . .261
A-4 Create an Event-Handling Sub Procedure . . . . . . . . . . . . . . . . . . .261
A-5 Calculate Federal Withholding Tax . . . . . . . . . . . . . . . . . . . . . . 262
A-6 Invoke an Independent Sub Procedure and a Function . . . . . . . . . . . . . 264
A-7 Create an Independent Sub Procedure . . . . . . . . . . . . . . . . . . . . 266
A-8 Create a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267
A-9 Validate an Application’s Code . . . . . . . . . . . . . . . . . . . . . . . .269
A-10 Professionalize Your Application’s Interface . . . . . . . . . . . . . . . . . 271
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .277
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
x
C ontents 

CHAPTER 7 S t r in g M an ipu lat io n . . . . . . . . . . . . . . . . . . . 287


F OCUS ON THE CONC EPTS LESSON . . . . . . . . . . . . . . . . . 288
F-1 Length Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
The Product ID Application . . . . . . . . . . . . . . . . . . . . . . . . . . 288
F-2 Insert Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
F-3 PadLeft and PadRight Methods . . . . . . . . . . . . . . . . . . . . . . . .290
The Net Pay Application . . . . . . . . . . . . . . . . . . . . . . . . . . . .291
F-4 Contains and IndexOf Methods . . . . . . . . . . . . . . . . . . . . . . . .293
The City and State Application . . . . . . . . . . . . . . . . . . . . . . . . .294
F-5 Substring Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .296
The Rearrange Name Application . . . . . . . . . . . . . . . . . . . . . . . .296
F-6 Character Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
The First Name Application . . . . . . . . . . . . . . . . . . . . . . . . . . 299
F-7 Remove Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
F-8 Trim, TrimStart, and TrimEnd Methods . . . . . . . . . . . . . . . . . . . . 302
The Tax Calculator Application . . . . . . . . . . . . . . . . . . . . . . . . .303
F-9 Replace Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
F-10 Like Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .305
Inventory Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . .307

APPLY THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . . . 309


A-1 Code the Check Digit Application . . . . . . . . . . . . . . . . . . . . . . .309
A-2 Code the Password Application . . . . . . . . . . . . . . . . . . . . . . . 314
A-3 Generate Random Integers . . . . . . . . . . . . . . . . . . . . . . . . . 317
A-4 Code the Guess a Letter Application . . . . . . . . . . . . . . . . . . . . .318
Use the Enabled Property and Focus Method . . . . . . . . . . . . . . . . . . 319
A-5 Code the Guess the Word Game Application . . . . . . . . . . . . . . . . . .322
Coding the btnNewWord_Click Procedure . . . . . . . . . . . . . . . . . . . .323
Coding the btnTryLetter_Click Procedure . . . . . . . . . . . . . . . . . . . .325
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .330
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .335

CHAPTER 8 Ar r ays . . . . . . . . . . . . . . . . . . . . . . . . . 341


F OCUS ON THE CONC EPTS LESSON . . . . . . . . . . . . . . . . . 342
F-1 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .342
F-2 Declaring One-Dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . 342
Storing Data in a One-Dimensional Array . . . . . . . . . . . . . . . . . . . . 345
Determining the Number of Elements in a One-Dimensional Array . . . . . . . . .346
Determining the Highest Subscript in a One-Dimensional Array . . . . . . . . . . 346
Traversing a One-Dimensional Array . . . . . . . . . . . . . . . . . . . . . . 347
F-3 For Each...Next Statement . . . . . . . . . . . . . . . . . . . . . . . . . .349
F-4 Calculating the Average Array Value . . . . . . . . . . . . . . . . . . . . . 350
F-5 Finding the Highest Array Value . . . . . . . . . . . . . . . . . . . . . . . 353
F-6 Sorting a One-Dimensional Array . . . . . . . . . . . . . . . . . . . . . . .355
F-7 Two-Dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . .358
Declaring a Two-Dimensional Array . . . . . . . . . . . . . . . . . . . . . . .358
Storing Data in a Two-Dimensional Array . . . . . . . . . . . . . . . . . . . . 360

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
xi
 

Determining the Highest Subscript in a Two-Dimensional Array . . . . . . . . . . 361


Traversing a Two-Dimensional Array . . . . . . . . . . . . . . . . . . . . . . 361
Totaling the Values Stored in a Two-Dimensional Array . . . . . . . . . . . . . .363
APPLY THE C ONCEPTS LESSON . . . . . . . . . . . . . . . . . . . 366
A-1 Associate an Array with a Collection . . . . . . . . . . . . . . . . . . . . .366
A-2 Create Accumulator and Counter Arrays . . . . . . . . . . . . . . . . . . . 367
A-3 Create Parallel One-Dimensional Arrays . . . . . . . . . . . . . . . . . . . .371
A-4 Search a Two-Dimensional Array . . . . . . . . . . . . . . . . . . . . . . .374
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .378
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .383

CHAP TER 9 Sequ en t ia l A ccess Fi l es and Menus . . . . . . . . . . . . . 392


FOCUS ON THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . 393
F-1 Sequential Access Files . . . . . . . . . . . . . . . . . . . . . . . . . . .393
F-2 Sequential Access Output Files . . . . . . . . . . . . . . . . . . . . . . . .393
Output File Example: Game Show Application . . . . . . . . . . . . . . . . . .395
F-3 Sequential Access Input Files . . . . . . . . . . . . . . . . . . . . . . . . 397
ReadToEnd Method Example: Game Show Application . . . . . . . . . . . . . . 399
ReadLine Method Example: Game Show Application . . . . . . . . . . . . . . . 401

APPLY THE C ONCEPTS LESSON . . . . . . . . . . . . . . . . . . . 404


A-1 Add a Menu to a Form . . . . . . . . . . . . . . . . . . . . . . . . . . . .404
GUI Guidelines for Menus . . . . . . . . . . . . . . . . . . . . . . . . . . .404
Menu Example: Continents Application . . . . . . . . . . . . . . . . . . . . . 405
A-2 Code the Items on a Menu . . . . . . . . . . . . . . . . . . . . . . . . . .408
A-3 Modify a Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .410
A-4 Accumulate the Values Stored in a File . . . . . . . . . . . . . . . . . . . .412
A-5 Sort the Data Contained in a File . . . . . . . . . . . . . . . . . . . . . . .414
A-6 Professionalize Your Application’s Interface . . . . . . . . . . . . . . . . . .416
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .418
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .420

CHAP TER 10 Clas s es a nd Obj ects . . . . . . . . . . . . . . . . . . . 427


FOCUS ON THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . 428
F-1 Object-Oriented Programming . . . . . . . . . . . . . . . . . . . . . . . . 428
F-2 Creating a Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
F-3 Instantiating an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
F-4 Attributes Section of a Class . . . . . . . . . . . . . . . . . . . . . . . . .431
Attributes Section Example: Franklin Decks Application . . . . . . . . . . . . . 433
F-5 Behaviors Section of a Class . . . . . . . . . . . . . . . . . . . . . . . . .436
Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .436
Methods Other than Constructors . . . . . . . . . . . . . . . . . . . . . . . 437
Behaviors Section Example: Franklin Decks Application . . . . . . . . . . . . . 438
Using the Rectangle Class: Franklin Decks Application . . . . . . . . . . . . . .438

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
xii
C ontents 

F-6 Adding a Parameterized Constructor to a Class . . . . . . . . . . . . . . . .443


F-7 Reusing a Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447

APPLY THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . . . 452


A-1 Use a ReadOnly Property . . . . . . . . . . . . . . . . . . . . . . . . . . 452
A-2 Create Auto-Implemented Properties . . . . . . . . . . . . . . . . . . . . .457
A-3 Overload Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .466
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .469

CHAPTER 11 S QL Ser ver Dat abases . . . . . . . . . . . . . . . . . . 475


F OCUS ON THE CONC EPTS LESSON . . . . . . . . . . . . . . . . . 476
F-1 Basic Database Terminology . . . . . . . . . . . . . . . . . . . . . . . . .476
F-2 Creating a SQL Server Database . . . . . . . . . . . . . . . . . . . . . . .478
F-3 Adding a Table to a Database . . . . . . . . . . . . . . . . . . . . . . . . 480
F-4 Adding Records to a Table . . . . . . . . . . . . . . . . . . . . . . . . . .483
F-5 Data Source Configuration Wizard . . . . . . . . . . . . . . . . . . . . . . 484
F-6 Binding the Objects in a Dataset . . . . . . . . . . . . . . . . . . . . . . .487
Having the Computer Create a Bound Control . . . . . . . . . . . . . . . . . .488
F-7 DataGridView Control . . . . . . . . . . . . . . . . . . . . . . . . . . . .491
F-8 Copy to Output Directory Property . . . . . . . . . . . . . . . . . . . . . .495
F-9 Try...Catch Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . .497
F-10 Two-Table Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . .499
Relating the Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .502
Creating a Database Query . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Displaying the Query Information . . . . . . . . . . . . . . . . . . . . . . . .506

APPLY THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . . . 508


A-1 Create a Data Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . .508
A-2 Bind Field Objects to Existing Controls . . . . . . . . . . . . . . . . . . . .511
A-3 Perform Calculations on the Fields in a Dataset . . . . . . . . . . . . . . . .513
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .517
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .520

CHAPTER 12 Dat abas e Qu er ies w i t h SQL . . . . . . . . . . . . . . . . 529


F OCUS ON THE CONC EPTS LESSON . . . . . . . . . . . . . . . . . 530
F-1 SELECT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . .530
F-2 Creating a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .533
F-3 Parameter Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . .540
F-4 Saving a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .544
F-5 Invoking a Query from Code . . . . . . . . . . . . . . . . . . . . . . . . .547

APPLY THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . . . 549


A-1 Add a Calculated Field to a Dataset . . . . . . . . . . . . . . . . . . . . . 549
A-2 Use the SQL Aggregate Functions . . . . . . . . . . . . . . . . . . . . . . 552
A-3 Professionalize Your Application’s Interface . . . . . . . . . . . . . . . . . .556

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
xiii
 

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .557
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .560

CHAP TER 13 Web Sit e A ppl i cati ons . . . . . . . . . . . . . . . . . . 565


FOCUS ON THE CONCEPTS LESSON . . . . . . . . . . . . . . . . . 566
F-1 Basic Web Terminology ��������������������������������������������������������������������������������566
F-2 Creating a Web Site Application ���������������������������������������������������������������������568
F-3 Starting a Web Application�����������������������������������������������������������������������������571
F-4 Modifying the Site.master Page ���������������������������������������������������������������������573
F-5 Personalizing the Default.aspx Page���������������������������������������������������������������576
F-6 Personalizing the About.aspx Page�����������������������������������������������������������������577
F-7 Testing with Different Browsers ���������������������������������������������������������������������579
F-8 Closing and Opening a Web Site Application�����������������������������������������������������579

APPLY THE C ONCEPTS LESSON . . . . . . . . . . . . . . . . . . . 580


A-1 Repurpose an Existing Web Page��������������������������������������������������������������������580
A-2 Add a Table and Controls to a Web Page���������������������������������������������������������582
A-3 Code a Control on a Web Page�����������������������������������������������������������������������585
A-4 Use a Validation Control��������������������������������������������������������������������������������587
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .590
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .592

APPEN DIX A GU I Des ign Gui del i nes . . . . . . . . . . . . . . . . . . 599

APPE N DIX B Addit io n al To pi cs . . . . . . . . . . . . . . . . . . . . 604

APPE N DIX C F in din g and Fi x i ng Program Errors . . . . . . . . . . . . . 632

APPEN DIX D V is u al B asi c 2 0 1 7 Cheat Sheet . . . . . . . . . . . . . . 647

APPEN DIX E Cas e Pro je ct s . . . . . . . . . . . . . . . . . . . . . . 667

Index . . . . . . . . . . . . . . . . . . . . . . . . . . 671

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
xiv

Preface

Programming with Microsoft Visual Basic 2017, Eighth Edition uses Visual Basic 2017, an
object-oriented language, to teach programming concepts. This book is designed for a beginning
programming course. However, it assumes that students are familiar with basic Windows skills
and file management.

Organization and Coverage


Programming with Microsoft Visual Basic 2017, Eighth Edition contains 13 chapters that
present concepts along with hands-on instruction; it also contains five appendices (A through E).
In the chapters, students with no previous programming experience learn how to plan and
create their own interactive Windows applications. GUI design skills, OOP concepts, and
planning tools (such as Planning Charts, pseudocode, and flowcharts) are covered in the book.
The chapters show students how to work with objects and write Visual Basic statements such as
If...Then...Else, Select Case, Do...Loop, For...Next, and For Each...Next. Students also learn how
to create and manipulate variables, constants, strings, sequential access files, classes, and arrays.
In Chapters 11 and 12, students learn how to create SQL Server databases and then use them
in applications. They also learn how to use Structured Query Language (SQL) to access specific
fields and records from the database and also to create calculated fields. Chapter 13 shows
students how to create both static and dynamic Web Site applications.
Appendix A contains a summary of the GUI design guidelines mentioned in the chapters.
Appendix B contains additional topics that can be covered along with (or anytime after) a
specified chapter. Appendix C teaches students how to locate and correct errors in their
code. The appendix shows students how to step through their code and also how to create
breakpoints. The Visual Basic 2017 Cheat Sheet contained in Appendix D summarizes
important concepts covered in the chapters, such as the syntax of statements, methods, and
so on. The Cheat Sheet provides a convenient place for students to locate the information they
need as they are creating and coding their applications. Appendix E contains Case Projects that
can be assigned after completing specific chapters in the book.

Approach
Each chapter in Programming with Microsoft Visual Basic 2017, Eighth Edition contains two
lessons titled Focus on the Concepts and Apply the Concepts. Each lesson has its own set of
objectives. The Focus lessons concentrate on programming concepts, using examples along with
sample applications designed to reinforce the concepts being taught. The Apply the Concepts
lessons show students how to apply the concepts from the chapter’s Focus lesson in different
ways. The Apply lessons also expand on the concepts taught in the Focus lesson. Both lessons
provide tutorial-style steps that guide the student on coding, running, and testing applications.
Each sample application allows the student to observe how the current concept can be used
before the next concept is introduced.

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Discovering Diverse Content Through
Random Scribd Documents
The Project Gutenberg eBook of The pioneer
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: The pioneer


A tale of two states

Author: Geraldine Bonner

Illustrator: Harrison Fisher

Release date: February 26, 2024 [eBook #73040]

Language: English

Original publication: Indianapolis: The Bobbs-Merrill Company,


1905

Credits: D A Alexander, David E. Brown, and the Online


Distributed Proofreading Team at
https://www.pgdp.net (This file was produced from
images generously made available by The Internet
Archive)

*** START OF THE PROJECT GUTENBERG EBOOK THE PIONEER


***
THE PIONEER
June
THE PIONEER
A TALE OF TWO STATES

By
GERALDINE BONNER
Author of Tomorrow’s Tangle

WITH ILLUSTRATIONS BY
HARRISON FISHER

INDIANAPOLIS
THE BOBBS-MERRILL COMPANY
PUBLISHERS
Copyright 1905
The Bobbs-Merrill Company

March

PRESS OF
BRAUNWORTH & CO.
BOOKBINDERS AND PRINTERS
BROOKLYN, N. Y.
CONTENTS
BOOK I
THE COUNTRY
CHAPTER PAGE
I The Squatter 3
II The Gracey Boys 12
III The Name of Allen 27
IV O, Mine Enemy! 44
V The Summons 54
VI The Old Love 65
VII Uncle Jim 85
VIII Prizes of Accident 99
BOOK II
THE TOWN
I Down in the City 109
II Feminine Logic 126
III One of Eve’s Family 140
IV Danger Signals 153
V The Great God Pan 166
VI Readjustment 183
VII Business and Sentiment 192
VIII New Planets 201
IX The Choice of Maids 214
X The Quickening Current 225
XI Lupé’s Chains are Broken 230
XII A Man and His Price 241
XIII The Breaking Point 252
XIV Bed-Rock 265
BOOK III
THE DESERT
I Nevada 281
II Old Friends with New Faces 286
III Smoldering Embers 304
IV A Woman’s “No” 316
V “Her Feet Go Down to Death” 329
VI The Edge of the Precipice 341
VII The Colonel Comes Back 352
VIII The Aroused Lion 368
IX Home 381
LIST OF ILLUSTRATIONS
PAGE
June Frontispiece
She Smiled Faintly at Him 40
“Here it is! Do You Wonder no one Ever
Found it?” 88
With the Tip of the Long Spear of Grass,
He Touched Her Lightly on the Cheek 176
Mercedes 244
Rosamund 306
THE PIONEER
BOOK I
THE COUNTRY
THE PIONEER
CHAPTER I
THE SQUATTER
It had been five o’clock in the clear, still freshness of a May morning
when the Colonel had started from Sacramento. Now, drawing rein
where the shadow of a live-oak lay like a black pool across the road,
he looked at his watch—almost five. The sun had nearly wheeled
from horizon to horizon.
During the burning noon hour he had rested at Murderer’s Bar.
Except for that he had been in the saddle all day, slackening speed
where the road passed over the burnt shoulder of the foot-hills,
descending into sheltered cañons by cool river-beds, pacing along
stretches of deserted highway where his mounted figure was the
only living thing in sight.
Stationary in the shade of the live-oak he looked about him. The rich
foot-hill country of California stretched away beneath his gaze in lazy
undulations, dotted with the forms of the oaks. The grass on
unprotected hilltops was already drying to an ocher yellow, the road
was deep in dust. Far away, hanging on the horizon like a faded
mirage, was the high Sierra, thin, snow-touched, a faint, aërial
vision.
The sleepy sounds of midday had died down and the strange,
dream-like silence so peculiar to California held the scene. It was like
looking at a picture, the Colonel thought, as he turned in his saddle
and surveyed the misty line of hill after hill, bare and wooded,
dwindling down to where—a vast, sea-like expanse swimming in
opalescent tints—stretched one of the fruitful valleys of the world.
Kit Carson, the finest horse procurable in the Sacramento livery
stable the Colonel patronized, stamped and flicked off a fly with his
long tail. His rider muttered a word of endearment and bent to pat
the silky neck, while his eyes continued to move over the great
panorama. He had traversed it many times. The first time of all rose
in his mind, when in the flush of his splendid manhood, he had
sought fortune on the bars and river-beds in forty-nine. Forty-nine!
That was twenty-one years ago.
Something in the thought clouded his brow and called a sigh to his
lips. He made a gesture as though shaking off a painful memory and
gathered up the hanging rein.
“Come, Kit,” he said aloud, “we’ve got to be moving. There’s fifteen
miles yet between us and supper.”
The road before them mounted a spur at the top of which it
branched, one fork winding up and on to the mining towns hidden in
the mountain crevices. The other turned to the right, and rising and
falling over the buttresses that the foot-hills thrust into the plain,
wandered down “the mother lode,” the great mineral belt of
California.
As they rose to the summit of the spur, the brilliancy of the air was
tarnished by a cloud of dust, and the silence disrupted by sounds.
The crack of whips cut into the tranquillity of the evening hour; the
jangling of bells and voices of men mingled in strident dissonance.
Both Kit and the Colonel rose above the curve of the hilltop with the
pricked ears and alert eyes of curiosity.
The left-hand road was blocked as far as could be seen with a long
mule train, one of the trains that a few years before had crossed the
Sierra to Virginia City, and still plied a trade with the California
mountain towns. The dust rose from it and covered it as though to
shut out from Heaven the vision of the straining animals, and
deaden the blasphemies of the men. Looking along its struggling
length, the end of which was lost round a turn of the road, the
Colonel could see the pointed ears, the stretched necks, and the
arched collars of the mules, the canvas tops of the wagons and over
all, darting back and forth, the leaping flash of the whips.
A forward wagon was stuck, and, groaning and creaking from an
unsuccessful effort to start it, the train subsided into panting
relaxation. From the dust the near-by drivers emerged, caught sight
of the rider, and slouched toward him. They were powerful men—
great men in their day, the California mule drivers.
They passed the time of day, told him their destination and asked
his. Going on to Foleys, was he? Mining? Supposed not. Not much
mining done round Foleys now. Like Virginia, pretty well petered.
“Virginia!” said one of them, “you’d oughter see Virginia! I’ve taken
my sixteen-mule team over the Strawberry Creek route and made
my ten dollars a day in Virginia, but it’s as dead now as forty-nine.”
Then they slouched back to their work. Through the churned-up
dust, red with the brightness of the declining sun, men came
swinging down from the forward end of the train, driving mules to
attach to the stalled wagon. About it there was a concentrating of
movement and then an outburst of furious energy. A storm of
profanity arose, the dust ascended like a pillar of red smoke, and in
it the forms of men struggled, and the lashes of the whips came and
went like the writhing tentacles of an octopus. The watcher had a
glimpse of the mules almost sitting in the violence of their endeavor,
and with a howl of triumph the wagon lurched forward. The next
moment the entire train was in motion, seeming to advance with a
single movement, like a gigantic serpent, each wagon-top a section
of its vertebrate length, the whole undulating slowly to the rhythmic
jangling of the bells.
The Colonel took the turning to the right and was soon traversing a
road which looped in gradual descent along the wall of a ravine. The
air was chilled by a river that tumbled over stones below. Greenery
of tree and chaparral ran up the walls. A white root gripping a rock
like knotty fingers, a spattering of dogwood here and there amid the
foliage, caught his eye.
Yes, Virginia had unquestionably “petered.” It had had a short life for
its promise. Even in sixty-eight they still had had hopes of it. This
was May, the May of seventy, and their hopes had not been realized.
Fortunately he had invested little there. California the Colonel had
found a good enough field for his investments.
He rode on out of the ravine, once again into the dry rolling land, his
mind turning over that question of investments. He had not much
else to think of. He was a lonely man, unmarried, childless, and rich.
What else was there for a man, who had passed his fifty-fifth year,
who did not care for women or pleasure, to concern himself about?
It was not satisfying; it brought him no happiness, but he had had
no expectation of that.
Twenty-one years ago the Colonel had waked to the realization that
he had missed happiness. She had been his, in his very arms then,
and he had thought to keep her there for ever. Then suddenly she
had gone, without warning, tearing herself from his grasp, and he
had known that she would never return. So he had tried to fill the
blankness she had left, with business—a sorry substitute! He had
spent a good deal of time and thought over this matter of investing,
and had seen his fortune accumulating in a safe, gradual way. It
would have been much larger than it was if he could have cured
himself of a tendency to give portions of it away. But the Colonel
was a pioneer, and there were many pioneers who had succeeded
better than he in finding happiness, if not so well in gaining riches.
As they had been successful in the one way, he had tried to remedy
a deficit in the other, and his fortune remained at about the same
comfortable level, despite his preoccupation in investments.
This very trip was to see about a new one in which there were great
possibilities. He had a strip of land at Foleys, back of the town,
purchased fifteen years ago when people thought the little camp
was to be the mining center of the region. Now, after he had been
regularly paying his taxes, and hearing that the place annually grew
smaller and deader, a mineral spring had been discovered on his
land. It was a good thing that something had been discovered there.
The hopes of Foleys had vanished soon after he had come into
possession of the tract. His efforts to sell it had been unsuccessful.
Some years ago—the last time he was up there—you couldn’t get
people to take land near Foleys, short of giving it to them. But a
mineral spring was a very different matter.
As Kit Carson bore him swiftly onward he reviewed the idea of his
new investment with increasing enthusiasm. If the spring was all
they said it was, he would build a hotel near it, and transform the
beautiful, unknown locality into a summer resort. There was an ideal
situation for a hotel, where the land swept upward into a sort of
natural terrace crested with enormous pines. Here the house would
be built, and from its front piazza guests rocking in shaker chairs
could look over miles of hills and wooded cañons, and far away on
clear days could see the mother-of-pearl expanse of the Sacramento
Valley.
A few years ago the plan would have been impossible. But now, with
the railroad climbing over the Sierra, it would be quite feasible to run
a line of stages from Sacramento; or, possibly, Auburn would be
shorter. There was even a hope in the back of the Colonel’s mind
that the railway might be induced to fling forth a spur as far as
Placerville. The Colonel had friendships in high places. Things that
ordinary mortals who were not rich, unattached pioneers, could not
aspire to, were entirely possible for Colonel James Parrish.
But—here came in the “but” which upsets the best laid plans. At this
point the squatter had loomed up.
The Colonel had hardly believed in the squatter at first. His claims
were so preposterous. He had come shortly after Parrish’s last visit,
nearly four years ago, and had taken up his residence in the half-
ruined cottage which had been built on the land in those days when
people had thought Foleys was going to be a great mining center.
When Cusack, the drowsy lawyer who “attended to Colonel Parrish’s
business interests in Foleys,” as he expressed it, let his client know
there was a squatter—a married man with two children—on the
land, the Colonel’s reply had been “let him squat.” And so the matter
had rested.
Now, when the Colonel wanted to take possession of his own, build
his hotel and develop his mineral spring, he had received the
intelligence that the squatter refused to go—that in fact he claimed
the land on a three and a half years’ tenancy undisturbed by notice
to leave, and on various and sundry “improvements” he had made.
It took the Colonel’s breath away. That little clause in the lawyer’s
letter about the wife and children had induced him to give his
permission for the squatter to occupy his cottage. Having no wife or
child of his own, he had a secret feeling of friendliness to all men,
who, even in poverty and unsuccess, had tasted of this supreme
happiness. And he had let the man remain there, undisturbed,
throughout the three and a half years, had forgotten him—in fact,
did not even know his name.
And then to be suddenly faced by the amazing insolence of the
claim! He with his flawless title, his record of scrupulously paid
taxes! He wrote to the Foleys lawyer, as to what “the improvements”
were, and received the reply that they consisted in “a garden
planted out and tended by the squatter’s daughters, and a bit of
vineyard land that the girls had pruned and cultivated into bearing
condition. There were repairs on the house, mending the roof and
the porch which was falling down. Allen had made these himself.”
Allen! It was the first time Colonel Parrish had heard the squatter’s
name. It sent a gush of painful memories out from his heart, and for
a space he sat silent with drooped head. Why was not the world
wide enough for him, and all who bore this name, to pass one
another without encounter!
Now, as he rode on the last stage of his journey, and over the
hilltops saw the smoke of the Foleys chimneys, his mind had once
again fallen on the squatter’s name. Strange coincidence that after
twenty-one years this name—a common one—should rise up
uncomfortably in his path. He smiled bitterly to himself. Fate played
strange tricks, and he felt, with a sense of shamed meanness, that
he would have regarded the squatter with more leniency if he had
borne any other name than Allen.
CHAPTER II
THE GRACEY BOYS
The smell of wood smoke and supper was in the air as the Colonel
rode down the main street of Foleys. Under the projecting roof that
jutted from the second-story windows and made a species of rude
arcade, men were sitting in the negligée of shirt sleeves, smoking
and spitting in the cool of the evening. They hailed the new-comer
with a word of greeting or a hand raised in salute to the side of a
head where a hat brim should have been.
The Colonel returned the salutations, and as Kit Carson paced
through the red dust to where the drooping fringe of locust trees hid
the façade of the hotel, looked curiously about him, noticing a slight
stir of life, an appearance of reviving vitality in the once moribund
camp. Foleys was not as dead as it had been four years ago. Fewer
of the shop doors were boarded up; there were even new stores
open.
He was speculating on this when he threw himself off his horse in
front of the hotel. The loungers on the piazza, dustered and shirt-
sleeved men, let their tilted chairs drop to the front legs, and rose to
greet him to a man. Anybody was an acquisition at Foleys, but
Colonel Jim Parrish, with the rumor of bringing a lawsuit into their
midst, was welcomed as the harbinger of a new era.
They were all around him shaking hands when Forsythe, the
proprietor, armed with a large feather duster, emerged from the
front door. He cut the new arrival out from their midst and drew him
into the hall. Here, dusting him vigorously, he shouted to Mrs.
Forsythe to prepare a room, and between sweeps of the duster,
inquired of him on the burning question of the squatter.
“Come to fire old man Allen, eh?” he queried. “Got your work cut out
for you with him.”
“He’ll find he’s barked up the wrong tree this time,” said the Colonel
grimly, “bringing me up from San Francisco on such a fool’s errand.”
“It’s about the galliest proposition I’ve ever heard. But he’s that kind,
drunk a lot of the time, and the rest of it tellin’ the boys round here
what a great man he used to be. He was glad enough to get twenty-
five dollars a month holdin’ down a small job in the assay office.”
At this moment a door to the right opened, yielding a glimpse of a
large bare dining-room set forth with neatly laid tables and
decorated with hanging strands of colored paper.
“Say,” said a female voice, “ain’t that Colonel Jim Parrish that just
come down the street?”
“That’s just who it is,” answered the Colonel, “and isn’t that Mitty
Bruce’s voice?”
This question called to the doorway a female vision in brilliant pink
calico. It was a buxom, high-colored country girl of some twenty-one
years, coarse featured but not uncomely, her face almost as pink as
her dress, her figure of the mature proportions of the early-ripening
Californian.
“Well, well, is this Mitty?” said the new-comer, holding out his hand.
“You have to come up to the foot-hills to see a handsome girl. I’d
never have known you, you’ve grown up so and got so good-
looking.”
Mitty sidled up giggling and placed a big, red paw in his.
“Oh, get out!” she said, “ain’t you just awful!”
“I won’t get out and I’m not a bit awful. You’ve got to take care of
me at supper and tell me everything that’s happened in Foleys since
I was here last.”
“Let her alone to do that,” said Forsythe. “There ain’t anything that
goes on in Eldorado and Amador Counties that Mitty don’t know.
She’s the best newspaper we got round here.”
Mrs. Forsythe here put her head over the stair-rail and informed the
Colonel that his room was ready. He ran up stairs to “wash up” while
the other two repaired to the dining-room.
A few minutes later he reappeared and entered the low-ceilinged
room that smelled of fresh paint and cooking. It was past the supper
hour at Foleys and only a few men lingered over the end of their
meal. By a table at the window, cleanly spread and set, Mitty was
standing. When she saw him she pulled out a chair and, with its
back resting against her waist, pointed to the seat.
“Set right down here,” she said, “everything’s ready for you.”
Then as he obeyed she pushed him in, saying over his shoulder:
“It’s real nice to see you again, Colonel. It seems awful long since
you was here last.”
The Colonel looked up at her with an eye of twinkling friendliness.
She was gazing at him with childish pleasure and affection. He had
known Mitty since her tenth year when Forsythe and his wife had
adopted her, the only child of a dying woman whose husband had
been killed in a mine.
“Good girl, Mitt,” he said. “Have you got all the gossip of the last
four years saved up for me?”
“I guess I can tell you as much as most,” she answered, not without
pride, and then flourished off to the hole in the dining-room which
communicated with the kitchen.
When she had set his supper before him she sat down opposite, her
elbows on the table, comfortably settled for the gossip the traveler
had requested.
“Foleys seems to be livening up,” he said. “I noticed several new
stores. What’s happening?”
“Foleys!” exclaimed Mitty, with the Californian’s loyalty to his native
burg, “Foleys is the liveliest town along the mother lode. There ain’t
nothing the matter with Foleys! It’s the Gracey boys’ strike up at the
Buckeye Belle mine that’s whooping things up.”
“Oh, that’s it, of course,” said the Colonel. “They say the Gracey
boys have really struck it this time. I heard some talk of it before I
came up. The report down below was that it was a pretty good
thing.”
“You bet,” said the young woman with a knowing air. “Nearly a year
ago one of the gentlemen connected with it said to me, ‘We’ve got a
mine there; bed-rock’s pitchin’ and there’s two bits to the pan.’ So I
wasn’t surprised when I heard they’d struck it. They’re goin’ to build
a twenty-stamp mill next thing you know.”
“Good for them!” said the Colonel. “The Gracey boys have been
mining for years all over this country and in Mexico and Nevada, and
this is the first good thing they’ve got. How far is it from here?”
“About twelve miles up in that direction—” she gave a jerk of her
hand to the right—“up on the other side of the South Fork. They
have to come here for everything. Barney Sullivan, the
superintendent, does most of their buying.”
She looked at the Colonel with a wide-eyed, stolid gaze as she gave
this insignificant piece of information. The look suggested to her vis-
à-vis that the information was not insignificant to her.
“Barney Sullivan,” he said, “I remember him. He’s been with them
for some years, was in Virginia City when they were there. He’s a
good-looking fellow with red hair.”
“Good-lookin’, did you say?” exclaimed Mitty, in a high key of
scornful disbelief. “Well, that’s more’n I can see. Just a red-headed
Irish tarrier, with the freckles on him as big as dimes. It’s a good
thing all the world don’t like the same kind of face.”
Her scorn was tinctured with the complacence of one who knows
herself exempt from similar charges. Mitty, secure in the knowledge
that her own patronymic was Bruce, affected a high disdain of the
Irish. She also possessed a natural pride on the score of her
Christian name, which in its unique unabbreviated completeness,
was Summit, in commemoration of the fact that upon that lofty
elevation of the Sierra she had first seen the light.
“You’ll be able to see all the Buckeye Belle crowd to-night,” she
continued; “they’ll be in now any time. There’s going to be a party
here.”
The Colonel looked up from his plate with the thrust-out lips and
raised brows of inquiring astonishment.
“The devil you say!” he ejaculated. “I arrived just at the right
moment, didn’t I? I suppose I’ll have to stand round looking at the
men knifing each other for a chance to dance with Miss Mitty Bruce.”
Mitty wriggled with delight and grew as pink as her dress.
“Well, not quite’s bad as that,” she said with bridling modesty, “but I
can have my pick.”
Her friend had finished the first part of his supper, and placing his
knife and fork together, leaned back, looking at her and smiling to
himself. She saw the empty plate, and rising, bent across the table
and swept it and the other dishes on to her tray with an air of
professional expertness. As she came back with the dessert the last
diner thumped across the wooden floor in noisy exit.
The plate that she set before the Colonel displayed a large slab of
pie. A breakfast cup of coffee went with it. He looked at them with
an undismayed eye, remarking:
“Who’s coming to the party? I’ll bet a new hat Barney Sullivan will be
here—the first man on deck, and the last to quit the pumps. But I
don’t suppose the Gracey boys will show up.”
“Yes, they will—both of ’em.”
“What, Black Dan? Black Dan Gracey doesn’t go to parties.”
“Well, he don’t generally. But he’s goin’ to this one. His daughter,
Mercedes, is here, that sort er spidery Spanish girl, and he’s goin’ for
her.”
Mitty, having seen that her guest had all that in Foleys made up the
last course of a complete and satisfactory supper, went round and
took her seat at the opposite side of the table. As she spoke he
noticed a change in her voice. Now, as he saw her face, he noticed a
change in it, too. There was a withdrawal of joy and sparkle. She
looked sullen, almost mournful.
“Black Dan Gracey’s daughter here?” he queried. “What’s she doing
so far afield? The last I heard of her she was in school in San
Francisco.”
“So she was until two days ago. Then some kind er sickness broke
out in the school, and her paw went down to bring her up here. She
was so precious she couldn’t come up from San Francisco alone. She
had to be brung all the way like she was made of gold and people
was tryin’ to steal her. They stopped here for dinner on their way up.
I seen her.”
“She promises to be very pretty,” said the Colonel absently. “They
say Gracey worships her.”
“Pretty!” echoed Mitty in a very flat voice. “I don’t see what makes
her so dreadful pretty. Little black thing! And anybody’d be pretty all
togged up that way. She’d diamond ear-rings on, real ones, big
diamonds like that.”
She held out the tip of her little finger, nipped between her third and
thumb.
“I guess that makes a difference,” she said emphatically, looking at
him with a pair of eyes which tried to be defiant, but were really full
of forlorn appeal.
“Of course it makes a difference,” said the Colonel cheeringly,
without knowing in the least what he meant, “a great difference.”
“They was all staring at her here at dinner. There was four men in
the kitchen trying to get a squint through the door, until the
Chinaman threw ’em out. And she knew jest as well as any one, and
liked it. But you oughter have seen her pretend she didn’t notice it.
Jest eat her dinner sort er slow and careless as if they was no one
round more important than a yaller dog. Only now and then she’d
throw back her head so’s her curls ’ud fall back and the diamond
ear-rings ’ud show. I said to paw flat-footed, ‘Go and wait on her
yourself, since you think she’s so dreadful handsome. I don’t do no
waiting on that stuck-up thing.’”
Mitty turned away to the window. Her recital of the sensation
created by the proud Miss Gracey seemed to affect her. There was a
tremulous undernote in her voice; her bosom, under its tight-drawn
pink calico covering, heaved as if she were about to weep.
The Colonel noted with surprise these signs of storm, and was
wondering what would be best to say to divert the conversation into
less disturbing channels, when Mitty, looking out of the window,
craned her neck and evidently followed with her eyes a passing
figure.
“There goes June Allen,” she said; “don’t she look shabby?”
The name caused the Colonel to stop eating. He raised his eyes to
his companion. She was looking at him with reviving animation in
her glance.
“That’s the daughter of old man Allen what’s squatted on your land,”
she explained. “You ain’t ever seen the girls, have you?”
The Colonel, who had finished, laid his napkin on the table.
“No,” he answered, “are they children?”
“Children!” echoed Mitty, “I guess not. June’s twenty and
Rosamund’s nineteen. I know ’em real well. They’re friends of mine.”
He raised his eyebrows, surprised and relieved at the information. It
would be less hard to oust the squatter if his children were of this
age than if they were helpless infants.
“What sort of girls are they?” he asked.
“Oh they’re real lovely girls. And they’ve got a wonderful education.
They know lots. They’re learned. Their mother learned it to them—”
Mitty stopped, a sound outside striking her ear. The Colonel was
looking at her with quizzical inquiry. The picture of the squatter’s
children, as educated, much less “learned,” filled him with amused
astonishment. He was just about to ask his informant for a fuller
explanation, when she rose to her feet, her face suffused with color,
her eyes fastened in a sudden concentration of attention on
something outside the window.
“Here they are,” she said in a low, hurried voice. “Get up and look at
them.”
He obeyed, not knowing whom she meant. In the bright light of the
after-glow he saw four figures on horseback—three men and a girl—
approaching down the deserted street. Behind them a pack burro,
his back laden with bags and valises, plodded meekly through the
dust. The Colonel recognized the men as the Gracey brothers and
their superintendent, Barney Sullivan. The girl he had not seen for a
year or two, and she was at the age when a year or two makes vast
changes. He knew, however, that she was Black Dan Gracey’s
daughter, Mercedes, who was expected at the dance.
The cavalcade came to a stop outside the window. From the piazza
the front legs of the loungers’ chairs striking the floor produced a
series of thuds, and the thuds were followed by a series of hails such
as had greeted the Colonel. But the loungers made no attempt to go
forward, as they had done in his case. An access of bashfulness in
the presence of beauty held them sheepishly spellbound. It
remained for Forsythe to dash out with his duster and welcome the
new arrivals with the effusion of a mining camp Boniface.
The Colonel, unseen, looked at them with perhaps not as avid a
curiosity as Mitty, but with undisguised interest. He had long known
the Gracey boys, as they were called, though Dan was forty-three
and Rion twelve years younger. He had often heard of their mining
vicissitudes, not only from men similarly engaged, but from
themselves on their occasional visits to San Francisco. The society of
that city had not yet expanded to the size when it fell apart into
separate sets. Its members not only had a bowing acquaintance, but
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookmass.com

You might also like