100% found this document useful (3 votes)
158 views60 pages

Full Clearly Visual Basic Programming With Microsoft Visual Basic 2012 3rd Edition Diane Zak Ebook All Chapters

Programming

Uploaded by

bellenteffo
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 (3 votes)
158 views60 pages

Full Clearly Visual Basic Programming With Microsoft Visual Basic 2012 3rd Edition Diane Zak Ebook All Chapters

Programming

Uploaded by

bellenteffo
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/ 60

Download the full version of the ebook at ebookname.

com

Clearly Visual Basic Programming with Microsoft


Visual Basic 2012 3rd Edition Diane Zak

https://ebookname.com/product/clearly-visual-basic-
programming-with-microsoft-visual-basic-2012-3rd-edition-
diane-zak/

OR CLICK BUTTON

DOWNLOAD EBOOK

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Microsoft Visual Basic 2015 RELOADED 6th Edition Edition


Diane Zak

https://ebookname.com/product/microsoft-visual-
basic-2015-reloaded-6th-edition-edition-diane-zak/

ebookname.com

Microsoft Visual Basic 2008 Express Programming for the


Absolute Beginner 1st Edition Ford

https://ebookname.com/product/microsoft-visual-basic-2008-express-
programming-for-the-absolute-beginner-1st-edition-ford/

ebookname.com

Visual Basic Game Programming with DirectX 1st Edition


Jonathan S. Harbour

https://ebookname.com/product/visual-basic-game-programming-with-
directx-1st-edition-jonathan-s-harbour/

ebookname.com

GIS Cartography A Guide to Effective Map Design 1st


Edition Gretchen N. Peterson

https://ebookname.com/product/gis-cartography-a-guide-to-effective-
map-design-1st-edition-gretchen-n-peterson/

ebookname.com
Mothers and Daughters in Arab Women s Literature 1st
Edition Edition Dalya Abudi

https://ebookname.com/product/mothers-and-daughters-in-arab-women-s-
literature-1st-edition-edition-dalya-abudi/

ebookname.com

Commodity Trading Advisors Risk Performance Analysis and


Selection Wiley Finance 1st Edition Greg N. Gregoriou

https://ebookname.com/product/commodity-trading-advisors-risk-
performance-analysis-and-selection-wiley-finance-1st-edition-greg-n-
gregoriou/
ebookname.com

Claude Monet 1st Edition Nina Kalitina

https://ebookname.com/product/claude-monet-1st-edition-nina-kalitina/

ebookname.com

The Solar System 9th Edition Michael A. Seeds

https://ebookname.com/product/the-solar-system-9th-edition-michael-a-
seeds/

ebookname.com

The Arabic Encyclopedia 1st Edition Boutros (Peter) Al-


Boustani

https://ebookname.com/product/the-arabic-encyclopedia-1st-edition-
boutros-peter-al-boustani/

ebookname.com
Breaking News How the Wheels Came off at Reuters 1st
Edition Brian Mooney

https://ebookname.com/product/breaking-news-how-the-wheels-came-off-
at-reuters-1st-edition-brian-mooney/

ebookname.com
This is an electronic version of the print textbook. Due to electronic rights restrictions,
some third party content may be suppressed. Editorial review has deemed that any suppressed
content does not materially affect the overall learning experience. The publisher reserves the right
to remove content from this title at any time if subsequent rights restrictions require it. For
valuable information on pricing, previous editions, changes to current editions, and alternate
formats, please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for
materials in your areas of interest.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
THIRD EDITION

CLEARLY VISUAL BASIC ®


PROGRAMMING WITH MICROSOFT ® VISUAL BASIC ® 2012

DIANE ZAK

Australia l Brazil l Japan l Korea l Mexico l Singapore l Spain l United Kingdom l United States

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Clearly Visual Basic: ª 2014 Course Technology, Cengage Learning
Programming with Microsoft
ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may be
Visual Basic 2012, Third Edition reproduced, transmitted, stored or used in any form or by any means graphic, electronic,
Diane Zak or mechanical, including but not limited to photocopying, recording, scanning, digitizing,
taping, Web distribution, information networks, or information storage and retrieval
Executive Editor: Kathleen McMahon
systems, except as permitted under Section 107 or 108 of the 1976 United States
Senior Product Manager: Alyssa Pratt Copyright Act, without the prior written permission of the publisher.
Editorial Assistant: Sarah Ryan
Content Project Manager:
For product information and technology assistance, contact us at
Jennifer Feltri-George
Cengage Learning Customer & Sales Support, www.cengage.com/support
Quality Assurance: Nicole Spoto
For permission to use material from this text or product,
Art Director: Cheryl Pearl, GEX
submit all requests online at cengage.com/permissions
Cover Designer: GEX Publishing Services Further permissions questions can be emailed to
Text Designer: Shawn Girsberger [email protected]
Senior Print Buyer: Julio Esperas
Proofreader: Suzanne Huizenga Library of Congress Control Number: 2013932801
Indexer: Constance A. Angelo
ISBN-13: 978-1-285-08410-7
Compositor: Integra Software Services Pvt. Ltd.
ISBN-10: 1-285-08410-1

Course Technology
20 Channel Center Street
Boston, MA 02210
USA

Some of the product names and company names used in this book have been used for
identification purposes only and may be trademarks or registered trademarks of their
respective manufacturers and sellers.
Course Technology, a part of Cengage Learning, reserves the right to revise this
publication and make changes from time to time in its content without notice.
Example: Microsoft® is a registered trademark of the Microsoft Corporation.
Cengage Learning is a leading provider of customized learning solutions with office
locations around the globe, including Singapore, the United Kingdom, Australia,
Mexico, Brazil, and Japan. Locate your local office at: www.cengage.com/global
Cengage Learning products are represented in Canada by Nelson Education, Ltd.
To learn more about Course Technology, visit
www.cengage.com/coursetechnology
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

Printed in the United States of America


1 2 3 4 5 6 7 19 18 17 16 15 14 13

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Brief Contents
iii

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . xii
C H AP T E R 1 I Am Not a Control Freak! (Control Structures) . . . . . . . . . 1
C H AP T E R 2 First You Need to Plan the Party (Problem-Solving Process) . . 17
C H AP T E R 3 I Need a Tour Guide (Introduction to Visual Basic 2012) . . . . 35
C H AP T E R 4 Do-It-Yourself Designing (Designing Interfaces) . . . . . . . . 63
C H AP T E R 5 The Secret Code (Assignment Statements) . . . . . . . . . . 87
C H AP T E R 6 Where Can I Store This? (Variables and Constants) . . . . . . 107
C H AP T E R 7 What’s Wrong With It? (Syntax, Logic, and Run Time Errors) . . 131
C H AP T E R 8 Decisions, Decisions, Decisions (Selection Structure) . . . . . 151
C H AP T E R 9 Time to Leave the Nest (Nested Selection Structures) . . . . . 185
C H AP T E R 1 0 So Many Paths…So Little Time (Multiple-Alternative
Selection Structures) . . . . . . . . . . . . . . . . . . . 211
C H AP T E R 1 1 Testing, Testing…1, 2, 3 (Selecting Test Data) . . . . . . . . 237
C H AP T E R 1 2 How Long Can This Go On? (Pretest Loops) . . . . . . . . . . 261
C H AP T E R 1 3 Do It, Then Ask Permission (Posttest Loops) . . . . . . . . . 293
C H AP T E R 1 4 Let Me Count the Ways (Counter-Controlled Loops) . . . . . . 305
C H AP T E R 1 5 I’m on the Inside; You’re on the Outside (Nested Loops) . . . . 329
C H AP T E R 1 6 I Hear You Are Breaking Up (Sub Procedures) . . . . . . . . . 353
C H AP T E R 1 7 Talk to Me (Function Procedures) . . . . . . . . . . . . . . 383
C H AP T E R 1 8 A Ray of Sunshine (One-Dimensional Arrays) . . . . . . . . . 403
C H AP T E R 1 9 Parallel and Dynamic Universes (More on
One-Dimensional Arrays) . . . . . . . . . . . . . . . . . . 431
C H AP T E R 2 0 Table Tennis, Anyone? (Two-Dimensional Arrays) . . . . . . . 455
C H AP T E R 2 1 Building Your Own Structure (Structures) . . . . . . . . . . . 479

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
BRIEF CONTENTS

C H AP T E R 2 2 I’m Saving for the Future (Sequential Access Files) . . . . . . 497


C H AP T E R 2 3 The String Section (String Manipulation) . . . . . . . . . . . 515
C H AP T E R 2 4 I’m Suffering from Information Overload (Access Databases) . . 539
C H AP T E R 2 5 The Missing “LINQ” (Querying a Database) . . . . . . . . . . 569
iv
C H AP T E R 2 6 I Love This Class (Creating a Class) . . . . . . . . . . . . . 587
C H AP T E R 2 7 Getting “Web-ified” (Web Applications) . . . . . . . . . . . . 611
A PP E N D I X A Data Types . . . . . . . . . . . . . . . . . . . . . . . . 645
A PP E N D I X B Answers to Mini-Quizzes and TRY THIS Exercises . . . . . . Online
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . 647

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents
v

Preface . . . . . . . . . . . . . . . . . . . . . . . . . xii
C H AP T E R 1 I Am Not a Control Freak! (Control Structures) . . . . . . . . 1
Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
The Sequence Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 2
The Selection Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
The Repetition Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

C H AP T E R 2 First You Need to Plan the Party (Problem-Solving Process) . . 17


How Do Programmers Solve Problems? . . . . . . . . . . . . . . . . . . . . . 18
Step 1—Analyze the Problem . . . . . . . . . . . . . . . . . . . . . . . . 18
Step 2—Plan the Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 20
Step 3—Desk-Check the Algorithm . . . . . . . . . . . . . . . . . . . . . . 24
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

C H AP T E R 3 I Need a Tour Guide (Introduction to Visual Basic 2012) . . . . 35


Ok, the Algorithm Is Correct. What’s Next? . . . . . . . . . . . . . . . . . . . . 36
Creating a Visual Basic Windows Application . . . . . . . . . . . . . . . . . . . 38
So Many Windows! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Creating the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Save, Save, Save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Whose Property Is It? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Using the FORMAT Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Lock Them Down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Ok, Let’s See the Interface in Action! . . . . . . . . . . . . . . . . . . . . . . 52
Closing the Current Solution . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Opening an Existing Solution . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Exiting Visual Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS

C H AP T E R 4 Do-It-Yourself Designing (Designing Interfaces) . . . . . . . . 63


Delegating the Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Making the Interface More User-Friendly . . . . . . . . . . . . . . . . . . . . . . 68
Do What I Tell You to Do . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
The Me.Close() Instruction . . . . . . . . . . . . . . . . . . . . . . . . . 74
vi Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

C H AP T E R 5 The Secret Code (Assignment Statements) . . . . . . . . . . 87


The Fun Starts Here . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
The Val Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Who’s in Charge of This Operation? . . . . . . . . . . . . . . . . . . . . . . . . . 91
Your Assignment, if You Choose to Accept It . . . . . . . . . . . . . . . . . . . . . 94
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

C H AP T E R 6 Where Can I Store This? (Variables and Constants) . . . . . . . 107


Using Shoe Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
So, What’s Your Type? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Let’s Play the Name Game . . . . . . . . . . . . . . . . . . . . . . . . . . 110
You’ll Need a Reservation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
How Many Variables Should I Use? . . . . . . . . . . . . . . . . . . . . . . . . 111
The TryParse Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Check, Please…I’m Ready to Go . . . . . . . . . . . . . . . . . . . . . . . . 115
Using Constants to Keep Things…Well, the Same . . . . . . . . . . . . . . . . . . 116
Dressing Up the Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

C H AP T E R 7 What’s Wrong With It? (Syntax, Logic, and Run Time Errors) . . . 131
There’s a Bug in My Soup! . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Finding Syntax Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Locating Logic Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
I’ve Reached My Breaking Point . . . . . . . . . . . . . . . . . . . . . . . . 141
Run Time Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

C H AP T E R 8 Decisions, Decisions, Decisions (Selection Structure) . . . . . 151


Someone Might Need to Make a Decision . . . . . . . . . . . . . . . . . . . . . 152
The If…Then…Else Statement . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Stop That Runner! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Are We in the Black or in the Red? . . . . . . . . . . . . . . . . . . . . . 160
You Deserve a Bonus . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Examining Another Problem Specification . . . . . . . . . . . . . . . . . . . 168
Hey, That’s Not the Way I Would Have Done It . . . . . . . . . . . . . . . . 173
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 vii
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

C H AP T E R 9 Time to Leave the Nest (Nested Selection Structures) . . . 185


Nested Selection Structures . . . . . . . . . . . . . . . . . . . . . . . . . 186
10-4, Over and Out . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
How Much Is It? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
That’s Way Too Logical for Me . . . . . . . . . . . . . . . . . . . . . . . . 198
Summary of Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

C H AP T E R 1 0 So Many Paths…So Little Time (Multiple-Alternative


Selection Structures) . . . . . . . . . . . . . . . . . . 211
Which Way Should I Go? . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
The Fitness Spa Health Club Application . . . . . . . . . . . . . . . . . . . 213
Don’t Be So Sensitive . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
What’s the Next Case on the Docket? . . . . . . . . . . . . . . . . . . . . . 220
Using Select Case in the Fitness Spa Health Club Application . . . . . . . . . . 222
Specifying a Range of Values in a Case Clause’s ExpressionList . . . . . . . . . . 223
Coding the ABC Corporation Application . . . . . . . . . . . . . . . . . . . 224
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

C H AP T E R 1 1 Testing, Testing…1, 2, 3 (Selecting Test Data) . . . . . . 237


Will Your Application Pass the Test? . . . . . . . . . . . . . . . . . . . . . . 238
The Coffee Palace–Version 1 Application . . . . . . . . . . . . . . . . . . . . 238
The Coffee Palace–Version 2 Application . . . . . . . . . . . . . . . . . . . . 241
Stop! This Is a Restricted Area! . . . . . . . . . . . . . . . . . . . . . . . 243
The Shady Hollow Hotel Application . . . . . . . . . . . . . . . . . . . . . . 245
The CD Shop Application . . . . . . . . . . . . . . . . . . . . . . . . . . 247
The Tiger Hotel Application . . . . . . . . . . . . . . . . . . . . . . . . . 250
I Need to Tell You Something . . . . . . . . . . . . . . . . . . . . . . . 251
Just When You Thought It Was Safe . . . . . . . . . . . . . . . . . . . . . 253
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS

C H AP T E R 1 2 How Long Can This Go On? (Pretest Loops) . . . . . . . . . . 261


Over and Over Again . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Do I Need a Loop? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
The Do…Loop Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Counter Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
viii Cheerleader Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
My Dream Car Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
The Sales Express Application . . . . . . . . . . . . . . . . . . . . . . . . . . 276
The InputBox Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Can I Abbreviate That Assignment Statement? . . . . . . . . . . . . . . . . . . . 283
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288

C H AP T E R 1 3 Do It, Then Ask Permission (Posttest Loops) . . . . . . . . . . 293


Testing After the Fact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
More on the Do…Loop Statement . . . . . . . . . . . . . . . . . . . . . . . . 296
Pseudocode and Flowchart Containing a Posttest Loop . . . . . . . . . . . . . . . 297
The Bouncing Robot Application . . . . . . . . . . . . . . . . . . . . . . . . . 297
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Key Term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

C H AP T E R 1 4 Let Me Count the Ways (Counter-Controlled Loops) . . . . . . . 305


When Will It Stop? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Spaceship–Version 1 Application . . . . . . . . . . . . . . . . . . . . . . . . 309
Spaceship–Version 2 Application . . . . . . . . . . . . . . . . . . . . . . . . 310
Hey, Turn That Noise Down! . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
The Monthly Payment Calculator Application . . . . . . . . . . . . . . . . . . . . 312
The Financial.Pmt Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
But They Said There Were No Strings Attached . . . . . . . . . . . . . . . . . . 315
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

C H AP T E R 1 5 I’m on the Inside; You’re on the Outside (Nested Loops) . . . . . 329


One Loop Within Another Loop . . . . . . . . . . . . . . . . . . . . . . . . . . 330
What Time Is It? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
What Do I Owe Each Month? . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
But I Want to Do It a Different Way . . . . . . . . . . . . . . . . . . . . . . . 341
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
C H AP T E R 1 6 I Hear You Are Breaking Up (Sub Procedures) . . . . . . . 353
What’s the Proper Procedure? . . . . . . . . . . . . . . . . . . . . . . . . 354
The Weekly Pay Application . . . . . . . . . . . . . . . . . . . . . . . . 356
Send Me Something . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
Just Give Me Its Value, Please . . . . . . . . . . . . . . . . . . . . . . . 360
Where Do You Live? . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 ix
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374

C H AP T E R 1 7 Talk to Me (Function Procedures) . . . . . . . . . . . . . 383


What’s the Answer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Price Calculator Application . . . . . . . . . . . . . . . . . . . . . . . . 387
Revisiting the Concert Tickets Application . . . . . . . . . . . . . . . . . . . 390
Which Way Is Better? . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397

C H AP T E R 1 8 A Ray of Sunshine (One-Dimensional Arrays) . . . . . . . . 403


Let’s Join the Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
You Are Just So One-Dimensional . . . . . . . . . . . . . . . . . . . . . . . 404
Airlines Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Modified Airlines Application . . . . . . . . . . . . . . . . . . . . . . . . 412
Salary Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
States Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425

C H AP T E R 1 9 Parallel and Dynamic Universes (More on


One-Dimensional Arrays) . . . . . . . . . . . . . . . . . 431
We Share the Same Subscripts . . . . . . . . . . . . . . . . . . . . . . . 432
West Coast Emporium Application . . . . . . . . . . . . . . . . . . . . . . 432
Will You Share That with Me? . . . . . . . . . . . . . . . . . . . . . . . . . 436
But I Don’t Know How Many There Are . . . . . . . . . . . . . . . . . . . . . 443
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449

C H AP T E R 2 0 Table Tennis, Anyone? (Two-Dimensional Arrays) . . . . . . 455


Let’s Table That Idea for Now . . . . . . . . . . . . . . . . . . . . . . . . 456
Revisiting the West Coast Emporium Application . . . . . . . . . . . . . . . . . 458
The GetUpperBound Method . . . . . . . . . . . . . . . . . . . . . . . . 461
Calendar Sales Application . . . . . . . . . . . . . . . . . . . . . . . . . 464
Medical Bills Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS

Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470


Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472

C H AP T E R 2 1 Building Your Own Structure (Structures) . . . . . . . . . . . 479


x Putting the Pieces Together . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Bonnette Pool & Spa Depot Application . . . . . . . . . . . . . . . . . . . . . . 482
Revisiting the West Coast Emporium Application…Again! . . . . . . . . . . . . . . . 485
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493

C H AP T E R 2 2 I’m Saving for the Future (Sequential Access Files) . . . . . . . 497


Sequential Access Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Write Those Lines of Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Now Read Those Lines of Text . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511

C H AP T E R 2 3 The String Section (String Manipulation) . . . . . . . . . . . . 515


Working with Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
How Many Characters Are There? . . . . . . . . . . . . . . . . . . . . . . . . . 516
I Need to Fit This in Somewhere . . . . . . . . . . . . . . . . . . . . . . . . . 519
Where Does It Begin? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
I Just Want a Part of It . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
The Rearrange Name Application . . . . . . . . . . . . . . . . . . . . . . . . 522
Throw Away Those Characters . . . . . . . . . . . . . . . . . . . . . . . . . . 525
I Like This Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534

C H AP T E R 2 4 I’m Suffering from Information Overload (Access Databases) . . . 539


Keeping Good Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
Connecting…Connecting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
What Fields and Records? . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
It’s a Binding Contract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
Let the Computer Do It . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
DataGridView Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
How Does Visual Basic Do It? . . . . . . . . . . . . . . . . . . . . . . . . . . 554
Thank You for Catching My Errors . . . . . . . . . . . . . . . . . . . . . . . 555
The Copy to Output Directory Property . . . . . . . . . . . . . . . . . . . . . . 557
I’ll Use My Own Controls, Thank You . . . . . . . . . . . . . . . . . . . . . . . 559
Coding the Next Record and Previous Record Buttons . . . . . . . . . . . . . . . 561
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
C H AP T E R 2 5 The Missing “LINQ” (Querying a Database) . . . . . . . . . 569
Asking Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
The Red Dragon Games Application . . . . . . . . . . . . . . . . . . . . . 572
One for All . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580 xi
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582

C H AP T E R 2 6 I Love This Class (Creating a Class) . . . . . . . . . . . . 587


That’s a Real Classy Object . . . . . . . . . . . . . . . . . . . . . . . . . 588
The Bonnette Pool & Spa Depot Application . . . . . . . . . . . . . . . . . . 589
Who Owns That Property? . . . . . . . . . . . . . . . . . . . . . . . . . 591
Behave Yourself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Constructive Behavior Is the Key to Success . . . . . . . . . . . . . . . . . 595
Methods Other than Constructors . . . . . . . . . . . . . . . . . . . . . . 596
Using the Pattern to Create an Object . . . . . . . . . . . . . . . . . . . . . 598
Pool Supplies Application . . . . . . . . . . . . . . . . . . . . . . . . . . 601
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607

C H AP T E R 2 7 Getting “Web-ified” (Web Applications) . . . . . . . . . . 611


Web Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
Creating a Web Application . . . . . . . . . . . . . . . . . . . . . . . . . 614
Adding the Default.aspx Web Page to the Application . . . . . . . . . . . . . . . 616
What Is Your Title? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
Adding Static Text to a Web Page . . . . . . . . . . . . . . . . . . . . . 618
Viewing a Web Page in Full Screen View . . . . . . . . . . . . . . . . . . . 620
Adding Another Web Page to the Application . . . . . . . . . . . . . . . . . . 621
Adding a Link Button Control to a Web Page . . . . . . . . . . . . . . . . . . 621
Starting a Web Application . . . . . . . . . . . . . . . . . . . . . . . . . 623
Adding an Image to a Web Page . . . . . . . . . . . . . . . . . . . . . . . 625
Closing and Opening an Existing Web Application . . . . . . . . . . . . . . . . 627
I Want to Move Somewhere Else . . . . . . . . . . . . . . . . . . . . . . . 628
Dynamic Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
Coding the Submit Button’s Click Event Procedure . . . . . . . . . . . . . . . . 632
Can You Validate This? . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639

A PP E N D I X A Data Types . . . . . . . . . . . . . . . . . . . . . . 645


A PP E N D I X B Answers to Mini-Quizzes and TRY THIS Exercises . . . . . Online
Index . . . . . . . . . . . . . . . . . . . . . . . . . 647

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface
xii

Clearly Visual Basic: Programming with Microsoft Visual Basic 2012, Third Edition is designed
for a beginning programming course. The book assumes students have no previous
programming knowledge or experience. However, students should be familiar with basic
Windows skills and file management. The book’s primary focus is on teaching programming
concepts, with a secondary focus on teaching the Visual Basic programming language. In other
words, the purpose of the book is to teach students how to solve a problem that requires a
computer solution. The Visual Basic language is used as a means of verifying that the solution
works correctly.

Organization and Coverage


Clearly Visual Basic: Programming with Microsoft Visual Basic 2012, Third Edition
contains 27 chapters and two appendices. In the chapters, students with no previous
programming experience learn how to analyze a problem specification and then plan and
create an appropriate computer solution. Pseudocode and flowcharts are used to plan the
solution, and desk-check tables are used to verify that the solution is correct before it is
coded. Students code the solutions using the Visual Basic 2012 language, and then desk-
check the code before it is executed. An entire chapter is devoted to teaching students how
to select appropriate test data. By the end of the book, students will have learned how to
write Visual Basic statements such as If…Then…Else, Select Case, Do…Loop, and
For…Next. Students also will learn how to create and manipulate variables, constants,
strings, sequential access files, structures, classes, and arrays. In addition, they will learn how
to connect an application to a Microsoft Access database, and then use Language Integrated
Query (LINQ) to query the database. They also will learn how to create simple Web
applications. The text also introduces students to OOP concepts and terminology. Appendix
A provides a listing of the data types available in Visual Basic. Appendix B, which is available
online at www.cengagebrain.com, contains the answers to the Mini-Quizzes and TRY THIS
Exercises in each chapter.

Approach
Rather than focusing on a specific programming language, Clearly Visual Basic:
Programming with Microsoft Visual Basic 2012, Third Edition focuses on programming
concepts that are common to all programming languages—such as input, output, selection,
and repetition. Concepts are introduced, illustrated, and reinforced using simple examples
and applications, which are more appropriate for a first course in programming. The
concepts are spread over many short chapters, allowing students to master the material one
small piece at a time. Because its emphasis is on teaching the fundamentals of programming,
the book covers only the basic controls, properties, and events available in Visual Basic.
Each chapter provides the steps for creating and/or coding one or more applications that use
the concepts covered in the chapter. The videos and PDF files that accompany each chapter
are designed to help students master the chapter’s concepts.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Organization and Coverage

Features
Clearly Visual Basic: Programming with Microsoft Visual Basic 2012, Third Edition is an
exceptional textbook because it also includes the following features:
READ THIS BEFORE YOU BEGIN This section is consistent with Cengage’s commitment to
helping instructors introduce technology into the classroom. Technical considerations and
assumptions about hardware, software, and default settings are listed in one place to help xiii
instructors save time and eliminate unnecessary aggravation.
DESIGNED FOR THE DIFFERENT LEARNING STYLES The book provides videos for visual and
auditory learners, and tutorial sections and Want More Info? files for kinesthetic learners.
VIDEOS These notes direct students to videos that accompany each chapter in the book. The
videos explain and/or demonstrate one or more of the chapter’s concepts, provide additional
information about the concepts, or cover topics related to the concepts. The videos are available
online at www.cengagebrain.com. Search for the ISBN of your title (from the back cover of your
book) using the search box at the top of the page. This will take you to the product page where
free companion resources can be found.
WANT MORE INFO? FILES These notes direct students to files that accompany each chapter in
the book. The files contain additional examples and further explanations of the concepts
covered in the chapter. The files are in PDF format. The files are available online at www.
cengagebrain.com.

FIGURES Figures that introduce new statements, functions, or methods contain both the syntax
and examples of using the syntax. Including the syntax in the figures makes the examples more
meaningful, and vice versa.
OBJECTIVES Each chapter begins with a list of objectives so you know the topics that will be
presented in the chapter. In addition to providing a quick reference to topics covered, this
feature provides a useful study aid.
MINI-QUIZZES Mini-Quizzes are strategically placed to test students’ knowledge at various
points in each chapter. Answers to the quiz questions are provided in Appendix B.
APPENDIX B Appendix B, which is available online at www.cengagebrain.com, contains the
answers to each chapter’s Mini-Quizzes and TRY THIS Exercises. The answers are provided to
give students immediate feedback and more opportunity for learning.
SUMMARY Each chapter contains a Summary section that recaps the concepts covered in the
chapter.
KEY TERMS Following the Summary section in each chapter is a listing of the key terms
introduced throughout the chapter, along with their definitions.
REVIEW QUESTIONS Each chapter contains Review Questions designed to test a student’s
understanding of the chapter’s concepts.
EXERCISES The Review Questions in each chapter are followed by Exercises, which provide
students with additional practice of the skills and concepts they learned in the chapter. The
Exercises are designated as TRY THIS, MODIFY THIS, INTRODUCTORY, INTERMEDIATE,
ADVANCED, FIGURE THIS OUT, and SWAT THE BUGS.
TRY THIS EXERCISES The TRY THIS Exercises should be the first Exercises students complete
after reading a chapter. These Exercises are similar to an application developed in the chapter,
and they allow students to test their understanding of the chapter’s concepts. The answers to
TRY THIS Exercises are provided in Appendix B.
MODIFY THIS EXERCISES In these Exercises, students modify an existing application.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
PREFACE Instructor Resources

FIGURE THIS OUT EXERCISES These Exercises require students to analyze a block of code and
then answer questions about the code.
SWAT THE BUGS EXERCISES The SWAT THE BUGS Exercises provide an opportunity for
students to detect and correct errors in an existing application.

xiv
New to This Edition!
VIDEOS The videos that accompany each chapter have been updated from the previous edition
of the book.

REVIEW QUESTIONS AND EXERCISES New Review Questions and Exercises have been added to
each chapter.
NEW EXAMPLES The chapters have been updated with new examples and sample applications.

CHAPTER 7 Run time errors are now introduced in Chapter 7.

CHAPTER 8 Chapter 8 now shows students how to prevent the “division by zero” run time
error. It also covers a control’s ForeColor property.
CHAPTER 9 Radio buttons are now covered in Chapter 9 rather than in Chapter 10.

CHAPTER 16 Chapter 16 now covers the CheckedChanged event procedure.

CHAPTER 18 Class-level arrays are now covered in Chapter 18 rather than in Chapter 19.
Chapter 18 also covers the form’s Load event procedure.
CHAPTER 23 The Replace method is now covered in Exercise 13 in Chapter 23 rather than in
the chapter itself.

Instructor Resources
All of the resources available with this book can be found at www.cengagebrain.com. At the
CengageBrain.com home page, search for the ISBN of your title (from the back cover of your
book) using the search box at the top of the page. This will take you to the product page where
free companion resources can be found.
ELECTRONIC INSTRUCTOR’S MANUAL The Instructor’s Manual that accompanies this textbook
includes additional instructional material to assist in class preparation, including items such as
Sample Syllabi, Chapter Outlines, Technical Notes, Lecture Notes, Quick Quizzes, Teaching
Tips, Discussion Topics, and Additional Case Projects.
EXAMVIEW® This textbook is accompanied by ExamView, a powerful testing software package
that allows instructors to create and administer printed, computer (LAN-based), and Internet
exams. ExamView includes hundreds of questions that correspond to the topics covered in this
text, enabling students to generate detailed study guides that include page references for further
review. The computer-based and Internet testing components allow students to take exams at
their computers, and also save the instructor time by grading each exam automatically.
POWERPOINT PRESENTATIONS This book offers Microsoft PowerPoint slides for each chapter.
These are included as a teaching aid for classroom presentation, to make available to students on
the network for chapter review, or to be printed for classroom distribution. Instructors can add
their own slides for additional topics they introduce to the class.
DATA FILES Data Files are necessary for completing the computer activities in this book. The
Data Files are also provided for students at www.cengagebrain.com.
SOLUTION FILES Solutions to the chapter applications and the end-of-chapter Review
Questions and Exercises are available for instructors.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Acknowledgments

Acknowledgments
Writing a book is a team effort rather than an individual one. I would like to take this
opportunity to thank my team, especially Jennifer Feltri-George (Content Project Manager),
Alyssa Pratt (Senior Product Manager), Nicole Ashton (Quality Assurance), Suzanne Huizenga
(Proofreader), Carmel Isaac (Integra), Sreejith Govindan (Client Manager, Integra), and the
compositors at Integra. Thank you for your support, enthusiasm, patience, and hard work. Last, xv
but certainly not least, I want to thank the following reviewers for their invaluable ideas and
comments: Bill Hammerschlag, Dallas County Community College District; Bobbie Hyndman,
Amarillo College; and Linda Truman, Abraham Baldwin Technical College.

Diane Zak

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Read This Before
xvi
You Begin

Technical Information
Data Files
You will need data files to complete the computer activities in this book. Your instructor may
provide the data files to you. You may obtain the files electronically at www.cengagebrain.com,
and then navigating to the page for this book.
Each chapter in this book has its own set of data files, which are stored in a separate folder
within the ClearlyVB2012 folder. The files for Chapter 3 are stored in the ClearlyVB2012\Chap03
folder. Similarly, the files for Chapter 4 are stored in the ClearlyVB2012\Chap04 folder.
Throughout this book, you will be instructed to open files from or save files to these folders.
You can use a computer in your school lab or your own computer to complete the chapter
applications and Exercises in this book.

Using Your Own Computer


To use your own computer to complete the computer activities in this book, you will need the
following:
l A Pentium® 4 processor, 1.6 GHz or higher, personal computer running Microsoft Windows.
This book was written using Microsoft Windows 8, and Quality Assurance tested using
Microsoft Windows 7.
l Either Microsoft Visual Studio 2012 or the Express Editions of Microsoft Visual Studio 2012
(namely, Microsoft Visual Studio Express 2012 for Windows Desktop and Microsoft Visual
Studio Express 2012 for Web) installed on your computer. This book was written and
Quality Assurance tested using Microsoft Visual Studio Professional 2012 and Microsoft
Visual Studio Express 2012 for Web. At the time of this writing, you can download a free
copy of the Express Editions at www.microsoft.com/visualstudio/eng/products/visual-studio-
express-products. If necessary, use the following information when installing the Professional
or Express Editions of the software:

To configure Visual Studio 2012:


1. Start Visual Studio 2012, VS Express for Desktop, or VS Express for Web. If the Choose
Default Environment Settings dialog box appears when you start Visual Studio, select the
Visual Basic Development Settings option.
2. Click TOOLS on the menu bar and then click Options to open the Options dialog box.
Click the Projects and Solutions node. Use the information shown in Figure 3-2 in
Chapter 3 to select and deselect the appropriate check boxes.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Read This Before You Begin

3. Expand the Projects and Solutions node in the Options dialog box and then click VB
Defaults. Verify that both Option Explicit and Option Infer are set to On. Also verify that
Option Strict and Option Compare are set to Off and Binary, respectively. Click the OK
button to close the Options dialog box.

Figures xvii
The figures in this book reflect how your screen will look if you are using Microsoft Visual
Studio Professional 2012 and a Microsoft Windows 8 system. Your screen may appear slightly
different in some instances if you are using another version of Microsoft Visual Studio or
Microsoft Windows.

Visit Our Web Site


Additional materials designed for this textbook might be available at www.cengagebrain.com.
Search this site for more details.

To the Instructor
To complete the computer activities in this book, your students must use a set of data files.
These files can be obtained electronically at www.cengagebrain.com.
The material in this book was written using Microsoft Visual Studio Professional 2012 on a
Microsoft Windows 8 system. It was Quality Assurance tested using Microsoft Visual Studio
Professional 2012 and Microsoft Visual Studio Express 2012 for Web on both a Windows 8 and
a Windows 7 system. The book assumes that both Option Explicit and Option Infer are set to
On, Option Strict is set to Off, and Option Compare is set to Binary. To verify these settings,
start your edition of Visual Studio. Click TOOLS on the menu bar and then click Options.
Expand the Projects and Solutions node in the Options dialog box and then click VB Defaults.
Verify the four Option settings and then click the OK button to close the Options dialog box.

Data Files
You are granted a license to copy the data files to any computer or computer network used by
individuals who have purchased this book.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CHAPTER 1
I Am Not a Control Freak!
(Control Structures)

After studying Chapter 1, you should be able to:

Describe the three control structures


Write simple algorithms using the sequence, selection,
and repetition structures

All Microsoft screenshots used with permission from Microsoft Corporation.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CHAPTER 1 I Am Not a Control Freak! (Control Structures)

Control Structures
All computer programs, no matter how simple or how complex, are written using one or more
of three basic structures: sequence, selection, and repetition. These structures are called control
structures or logic structures because they control the flow of a program’s logic. You will use
the sequence structure in every program you write. In most programs, you also will use the
2 selection and repetition structures. For maximum flexibility and to write powerful programs,
you can use the three control structures in many different combinations throughout your
program. This chapter gives you an introduction to the three control structures. More detailed
information about each structure, as well as how to implement these structures using the Visual
Basic language, is provided in subsequent chapters.

The Sequence Structure


You already are familiar with the sequence structure because you use it each time you follow a
set of directions, in order, from beginning to end. The directions might be a cookie recipe; or,
they might be the MapQuest directions to your favorite restaurant. The directions must be in
the correct order to produce the desired result. A cookie recipe, for example, must produce
edible cookies. The MapQuest directions, on the other hand, must deliver you to your intended
destination. In a computer program, the sequence structure directs the computer to process
the program instructions, one after another, in the order listed in the program. You will find the
sequence structure in every program.
You can observe how the sequence structure works by programming a robotic character named
Harold. Like a computer, Harold has a limited instruction set. In other words, he can understand
only a specific number of instructions, also called commands. For now, you will use only three of
the commands from Harold’s instruction set: walk forward, turn left 90 degrees, and sit down on
the bench. When told to walk forward, Harold takes one complete step forward. In other words,
he moves one of his feet forward one step and then moves his other foot to meet it.
For this first example, Harold is standing outside facing a park bench. The bench is two steps
away from Harold. Your task is to write the instructions, using only the commands that Harold
understands, that direct Harold to sit down on the bench. Figure 1-1 shows the problem
specification along with an illustration of the problem. It also shows five instructions that Harold
must follow to get him from where he is now to his ultimate destination, which is sitting on the
bench. The five instructions are called an algorithm, which is a set of step-by-step instructions
Ch01-Harold that accomplish a task. Harold must follow the instructions in order—in other words, in
Sequence sequence. (You can observe Harold following the algorithm shown in Figure 1-1 by viewing the
video Ch01-Harold Sequence video.)

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Control Structures

Harold is standing outside facing a park bench. The bench is two steps away from Harold. Write the
instructions that direct Harold to sit down on the bench.

1. walk forward
2. walk forward
3. turn left 90 degrees algorithm
4. turn left 90 degrees
5. sit down on the bench

Figure 1-1 An example of the sequence structure


Image by Diane Zak; Created with Reallusion CrazyTalk Animator

The Selection Structure


As with the sequence structure, you already are familiar with the selection structure, also called
the decision structure. The selection structure indicates that a decision needs to be made,
followed by an appropriate action derived from that decision. The decision is based on a
condition that must be evaluated before an action can occur. A condition can evaluate to either
true or false. You use the selection structure every time you drive your car and approach a
railroad crossing. Your decision, as well as the appropriate action, is based on a condition involving
the crossing signals (flashing lights and ringing bells). If the crossing signals are on (true), the
appropriate action is to stop your car before crossing the railroad tracks; otherwise (false), the
appropriate action is to proceed with caution over the railroad tracks. When used in a computer
program, the selection structure alerts the computer that a decision needs to be made based on
some condition, and it provides the appropriate action to take based on the result of that decision.
To observe how the selection structure works, we’ll make a slight change to the problem
specification shown in Figure 1-1. Sometimes Harold’s cat Ginger is sitting on the park bench
and needs to be gently pushed off before Harold can sit down. What changes will need to be
made to the original algorithm from Figure 1-1 as a result of this minor modification? The first
two instructions in the original algorithm position Harold directly in front of the bench; Harold
will still need to follow those instructions. However, before he follows the third instruction,
which is to turn left 90 degrees in preparation for sitting down, Harold will need to make a
decision about Ginger and then take the appropriate action based on the result. More
specifically, he will need to determine whether Ginger is on the bench; if she is on the bench,
then he needs to gently shove her off.
To write an algorithm to accomplish the current task, you need to use three additional
instructions from Harold’s instruction set: if Ginger is on the bench, do this:, end if, and gently

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CHAPTER 1 I Am Not a Control Freak! (Control Structures)

shove Ginger off the bench. The if Ginger is on the bench, do this: instruction allows Harold to
make a decision about the status of Ginger, and it represents the beginning of a selection
structure. The Ginger is on the bench portion is the condition that Harold must evaluate to
make a decision. Notice that the condition results in either a true or a false answer: either
Ginger is on the bench (true) or she’s not (false). The end if instruction denotes the end of a
selection structure.
4
The last three instructions in the original algorithm turn Harold left 180 degrees and then sit
him down; Harold will still need to follow those instructions. Figure 1-2 shows the modified
problem specification, illustration, and algorithm. Notice that the gently shove Ginger off the
bench instruction is indented within the selection structure. Indenting in this manner indicates
that the instruction should be followed only when Ginger is on the bench—in other words, only
when the condition results in an answer of true. The instructions to be followed when a
selection structure’s condition evaluates to true are referred to as the structure’s true path.
Ch01-Harold Although the true path in Figure 1-2 includes only one instruction, it can include many
Selection instructions. (You can observe Harold as he follows Figure 1-2’s algorithm by viewing the
video Ch01-Harold Selection video.)

Harold is standing outside facing a park bench. The bench is two steps away from Harold. Harold’s cat
Ginger may be on the bench. Write the instructions that direct Harold to gently shove Ginger off the
bench (if necessary) and then sit down on the bench.

Ginger might or might


not be on the bench

1. walk forward
2. walk forward condition

3. if Ginger is on the bench, do this:


gently shove Ginger off the bench indent
end if
4. turn left 90 degrees
5. turn left 90 degrees
6. sit down on the bench

Figure 1-2 An example of the selection structure


Image by Diane Zak; Created with Reallusion CrazyTalk Animator

Figure 1-3 shows how the selection structure can be used in a game program. In this game,
our superhero gets one shot at the villain. He needs to raise his right arm before taking the
shot. If he hits the villain, he should say “Got Him” and then lower his right arm. If he doesn’t

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Control Structures

hit the villain, he should say “Missed Him” before lowering his right arm. Our superhero can
understand only these eight instructions: raise right arm, lower right arm, shoot at the villain, if
the villain was hit, do this:, otherwise, do this:, end if, say “Got Him”, say “Missed Him”.

The superhero gets one shot at the villain. He needs to raise his right arm before taking the shot. If he
hits the villain, he should say “Got Him” and then lower his right arm. If he doesn’t hit the villain, he
should say “Missed Him” before lowering his right arm. 5

1. raise right arm


2. shoot at the villain
condition

3. if the villain was hit, do this:


say “Got Him” indent
otherwise, do this:
say “Missed Him” indent
end if
4. lower right arm

Figure 1-3 Another example of the selection structure


Image by Diane Zak; Created with Reallusion CrazyTalk Animator

Unlike the selection structure from Figure 1-2, which requires Harold to take a specific action
only when the structure’s condition evaluates to true, the selection structure in Figure 1-3
requires our superhero to take one action when the condition evaluates to true, but a different
action when it evaluates to false. In other words, the selection structure in Figure 1-3 has both a
true path and a false path. The otherwise, do this: instruction marks the beginning of the false
path instructions. Notice that the say “Got Him” and say “Missed Him” instructions are
indented within their respective paths. Indenting in this manner clearly indicates the instruction
to be followed when the condition evaluates to true (the villain was hit), as well as the one to be
Ch01-
followed when the condition evaluates to false (the villain was not hit). Although both paths in
Superhero
Figure 1-3’s selection structure contain only one instruction, each can contain many Selection
instructions. (You can observe our superhero in action by viewing the Ch01-Superhero video
Selection video.)

The Repetition Structure


The last of the three control structures is the repetition structure. Like the sequence and
selection structures, you already are familiar with the repetition structure. For example,
shampoo bottles typically include the repetition structure in the directions for washing your
hair. Those directions usually tell you to repeat the “apply shampoo to hair,” “lather,” and “rinse”
steps until your hair is clean. When used in a program, the repetition structure directs the
computer to repeat one or more instructions until some condition is met, at which time the

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Random documents with unrelated
content Scribd suggests to you:
Abb. 9. Kirche von Pfaffroda mit alter Kastaniengruppe

So blank der Spiegel des Teiches lockt, wir wandern geradeaus


über Höhen und Wälder und stehen bald vor der ehrwürdigen
Kirche. Aus steil ansteigendem Schieferdach ragt ein zierlicher
Dachreiter, dem man es gar nicht zutraut, daß in ihm die schweren,
großen Glocken geborgen sind. Um die weißen Mauern zieht sich
rundum ein alter Wehrgang, aus mächtigen, uralten Baumstämmen
fest gefügt. Schießscharten in den Wänden und Gießluken in dem
über die Mauer hinausragenden Boden zeigen, wozu er angebracht
wurde: daß sich in Zeiten der Not die friedliche Kirche in eine
Zuflucht und Burg für die Bewohner verwandeln konnte. Der
störende Schieferbelag ist bei der Erneuerung im Jahre 1912 von der
Patronatsherrschaft auf Anregung der Kommission zur Erhaltung der
Kunstdenkmäler entfernt, und der wohlerhaltene Wehrgang so in
seiner alten Form wieder zutage gebracht worden. Besonders schön
ist auch der Treppenaufgang zur Kirche. Ein Torhäuschen schützt
ihn, und auf ihm finden wir wohl noch einen Rest von der alten
Dorotheenkapelle wieder. Wie käme sonst an diese Stelle als eiserne
Krönung das bischöfliche Doppelkreuz?

Abb. 10. Alte Wehrkirche in Dörntal

Mit der Berglehne, die die Kirche trägt, ist schon eine ansehnliche
Höhe erklommen. Weit unten im Süden sieht man das Tal der Biela
sich nach Sayda hinaufziehen. Wir schwanken, ob wir wieder
hinunter sollen, um dem Bachlauf zu folgen. Aber es ist nicht nötig.
Auf der Höhe führt die Straße weiter nach Sayda zu. Es wandert sich
so schön und friedlich auf ihr, und man mag es kaum glauben, daß
hier Winter und Wetter so unheimlich hausen können, daß es zur
schwersten Gefahr für den Wanderer wird. Aber der Chronist
Lehmann berichtet uns anschaulich ein Ereignis, das sich gerade hier
im Jahre 1654 abgespielt hat: »Den 7. 11. gehet der Pfarrer zu
Dörnthal Johann Haberstroh in den Flecken Sayda am Gebirge zum
Markt und kauft nicht mehr denn ein paar Pfund Fleisch und vor
einen Groschen Brätzlein, darauf er sein schwanger Weiblein hatte
vertröstet. Im Rückwege kommet er im Windsturm von der Bahn ab
in die Irre und ins Wasser nahe ans Dorf, und ob er sich gleich
wieder herausgearbeitet und jämmerlich um Rettung geruft, haben
doch sein Rufen die Leute vor ein Windbrausen gehalten und ihn
hilflos gelassen, daß er naß und matt im Frost verderben müssen.
Frühe hat man ihn tot gefunden, also daß er auch in der Todesangst
die Nägel an Händen abgerissen.« –
Durch waldige Höhen führt der Weg. Er senkt sich sogar ein
wenig, und da sieht man denn bald gegenüber auf einer anderen
Höhe Sayda liegen. Es hilft nichts, wir müssen noch ein tiefes Tal bei
Pilsdorf an der Bielaquelle kreuzen, um nach Sayda hinauf zu
gelangen. Schlicht ist das Bild, das das Städtchen heute bietet. Vor
dem großen Brande 1842 mag es malerischer und reicher
ausgesehen haben. Seine Vergangenheit hatte es – erst als
böhmische, dann als meißnische Grenzwarte – zu einem wichtigen
festen Ort auf der Gebirgsstraße nach Brüx gemacht. Auch die uralte
Salzstraße von Halle über Öderan nach Brüx führte hier durch, die
bis vor wenigen Jahren noch als tiefer Hohlweg kenntlich war und
erst hinter Sayda im Purschensteiner Wald wieder als solcher zutage
tritt. Wie unendlich viele Fuhrwerke ihre Geleise in das Erdreich
gegraben haben müssen, beweisen die Aufzeichnungen, daß die
Straße im Jahre 1550 als sechs Ellen tiefer Hohlweg durch Sayda
führte. Um den Verkehr zu erleichtern, ließ damals Caspar v.
Schönberg auf Purschenstein die Höhlung ausfüllen und 1555 die
Straße pflastern.
Denn auch Stadtherren von Sayda waren die Herren von
Schönberg. An der Stelle, wo heute die sogenannte alte Schule
steht, erhob sich ein festes Schloß, von dem leider auf keinem alten
Stich oder sonstwo eine Abbildung zu finden ist, und auch Reste,
außer dem befestigten Untergrunde, sind nicht mehr vorhanden.
Sein Turm war dicker, als der bekannte Donatsturm in Freiberg, und
noch im achtzehnten Jahrhundert diente es als Quartier für den
Kommandeur einer Kürassierschwadron, die hier dauernd in
Garnison lag. Nach dem erwähnten großen Brande wurde das schon
baufällige Schloß und ebenso die Stadttore als Steinbruch benutzt,
und die Steine zum Wiederaufbau der Wohnhäuser verwendet. So
mag in mancher alten Hausmauer ein Rest ehemaliger
Steinmetzverzierung schlummern, ohne daß der Bewohner selbst es
ahnt.
Überhaupt ist Sayda oft von schweren Bränden heimgesucht
worden. So in den Jahren 1465, 1599, 1634, 1702 und 1842. Der
Brand von 1465 hat zu einer gewaltsamen Vertreibung aller Juden
aus der Stadt geführt, da man ihnen die Schuld an ihm beimaß. Daß
aber überhaupt ein Judenviertel hier bestanden hat, ist wiederum
der Beweis, daß Sayda ein nicht unbedeutender Handelsplatz
gewesen sein muß.
In der Mitte des Ortes etwa liegt die Kirche. Von Nordwesten zieht
sich der älteste Teil der Stadt an sie heran, der sogenannte Plan, ein
Platz, um den alte Holz- und Fachwerkhäuser stehen. Es sind die
einzigen, die der Brand von 1842 unversehrt gelassen hat. Die Sage
erzählt, daß 1813 eine Zigeunerin die Häuser auf hundert Jahre
»versprochen« hatte, und als dann gerade 1913 mehrere durch
Feuer zerstört wurden, verfehlte dieses Ereignis seinen Eindruck
nicht. Innen ist die Kirche mit zahlreichen schönen Denkmälern der
Familie v. Schönberg geziert, meist aus dem 16. und 17.
Jahrhundert. Außen zeigt sie eine schlichte Gotik. Nur das
würfelförmige Untergeschoß des Turmes ist mit älteren
Steinornamenten verziert, in denen noch romanisches
Formempfinden nachklingt.
Jetzt trägt der Turm eine schlanke schlichte Spitzhaube, die man
weit im Gebirge herübergrüßen sieht. Von oben tut sich eine
unendliche Fernsicht auf. Überall wogen waldige Hügel und Berge
aus weichen Tälern empor, und in noch deutlich erkennbarer Ferne
sieht man die drei Schlösser, Frauenstein, Purschenstein und
Pfaffroda liegen. Es ist das kein Zufall. Alle drei Schlösser waren
einst im Besitz der Familie v. Schönberg, und der Turm des Saydaer
Schlosses, den heute der Kirchturm ersetzen muß, war so angelegt,
daß man von ihm in unruhigen Zeiten Feuerzeichen nach allen drei
Schlössern hin geben konnte, die dort vom Wächter sofort
wahrgenommen werden mußten. Die Herrschaft Frauenstein ist
dann der Familie verloren gegangen, als der Kurfürst sie gewaltsam
»einzog«.
Von alten Gebäuden fällt am östlichen Ausgange noch das
sogenannte Hospital auf, das über der Tür das Schönbergsche
Wappen, umrahmt vom Johanniterorden, in schöner Arbeit ziert.
Dieses Hospital St. Johannis wurde von Bernhard v. Schönberg auf
dem Sterbelager gestiftet, als er, im Jahre 1476 von Jerusalem
heimkehrend, auf der Insel Rhodos starb. Das jetzt dort stehende
schlichte Gebäude, 1784 erbaut, dient als Altersheim. –
Dunkler Fichtenwald schiebt seinen Saum hier ziemlich nahe an
die Stadt, aber vor ihm steht noch ein neu entstandenes Viertel
Saydas. Hier sind Wohnhäuser, namentlich für die Beamten errichtet.
Denn auch hier verlangt die wachsende Einwohnerzahl räumliche
Erweiterung.
Abb. 11. Kirchturm von Sayda mit dem alten
»Plan«
Achtet man übrigens auf die Vegetation, dann wird einem klar, daß
zwischen hier und Olbernhau ein Klimaunterschied von gut vier
Wochen besteht. Wenn z. B. in Olbernhau schon Anfang Juni die
Rosen blühen, so erschließen sie sich hier oben erst Mitte Juli; und
so ist es auch im Herbst mit der Feldernte, die gar oft unter dem
Schnee hervor geborgen werden muß. –
Abb. 12. Sayda. Hospital St. Johannis
In einer Talschlinge mit weitem Fernblick nach Süden liegen
idyllisch zwei Teiche, die sogenannten Schwemmteiche, – ein Ziel,
das im Sommer zahlreiche Menschen anlockt. Der Weg steigt wieder
an, und hinter einer Biegung taucht ein altes Gebäude von seltsam
großen Ausmaßen auf, das sogenannte Große Vorwerk. Auf einem
mächtigen steinernen Unterbau erhebt sich ein schönes
Fachwerkgeschoß, und friesartig laufen um die Mauern eigenartige
Putzornamente vom Ende des 16. Jahrhunderts. Merkwürdigerweise
ist das alte Gehöft immer von feindlichen Zerstörungen verschont
geblieben.
Aus dem Grunde des weiten Tales, das sich nun aufgetan hat,
grüßen die charakteristischen drei Türme des Schlosses
Purschenstein. Schon von ferne kann man die zweckmäßige Anlage
solcher alten Sitze erkennen: Im Grunde eines weiten Talkessels auf
einem dort aufsteigenden Felsrücken errichtet, liegen sie einerseits
so hoch, daß sie gegenüber den Fernwaffen der damaligen Zeit
durchaus gesichert waren, andererseits aber so tief, daß die rauhen
Stürme des Winters von den Höhenzügen abgehalten werden.

Abb. 13. Das »große Vorwerk« von Purschenstein

Ein uralter fester Ort ist dieses Purschenstein. Seinen Namen,


ursprünglich Borsenstein, hat es von dem Ritter Borso von
Riesenburg, der als Schutzherr des Klosters Ossegg gleichzeitig mit
den Zisterziensern über den Gebirgskamm zog und während diese
weiter westlich die Siedlung Pfaffroda anlegten, hier sein festes
Schloß erbaute. Wie es dann unter den Markgrafen von Meißen an
die Familie v. Schönberg kam, ist oben schon erwähnt. Liegen heute
auch zahlreiche Nebengebäude um das Schloß, so erkennt man doch
noch deutlich den Charakter als äußerst feste Burg: Von der einen
Seite ist der steilabfallende Felsrücken durch das Tal der Flöha, auf
der anderen Seite durch mehrere künstlich angedämmte Wehrteiche
gegen feindliche Angriffe geschützt. Auf der schmalen Nordseite
lagerte sich ehemals ein wehrhafter Halsgraben vor, und der südliche
Abfall war durch starke Mauern mit zwei jetzt verfallenen Türmen
gedeckt. Nicht genug damit, umgab eine dreifache Mauerwehr die
eigentliche Burg, und fünf starke Türme, von denen drei noch heute
stehen, bildeten feste Verteidigungspunkte. Von der innersten Mauer
steht heute noch ein Teil in Gestalt eines bogenförmigen
Laubenganges. Ehemals zog sich dieser auf drei Seiten rundherum
und war mit einem Wehrgang versehen, während die vierte Seite
das Wohngebäude selbst bildete. Und selbst wenn diese fast
uneinnehmbare Anlage in Feindeshand gefallen war, konnten sich die
Bewohner immer noch in den festen Bergfried zurückziehen, zu dem
ein Eingang nur hoch oben, in Höhe etwa einer dritten Etage, führt.
Denkt man sich den Zugang zu ihm in Form einer hölzernen Treppe
oder Brücke, und diese Brücke dann in äußerster Not
weggeschlagen, so konnten hier die Bewohner vor jedem Ansturm
sicher sein, solange nicht der Hunger sie zur Übergabe zwang. –
Vergegenwärtigt man sich dies, dann erscheint es einem gar nicht
verwunderlich, daß sich hier im Dreißigjährigen Krieg, 1643, vierzig
schwedische Reiter wochenlang gegen eine starke feindliche
Belagerung durch die Kaiserlichen halten und nicht zur Übergabe
gezwungen werden konnten.
Zeichnung des Verfassers
Abb. 14. Schloß Purschenstein
Unten im Orte Neuhausen wogt rastlos das Leben der neuen Zeit.
Ursprünglich durch die Wasserkraft der Flöha herbeigezogen, hat
sich eine lebhafte Industrie entwickelt, und weithin erstreckt sich
schon heute der Ort. Darüber erhebt sich im Süden der Gipfel der
Schwarte, der schon von Ferne überall auftauchte, und hier, trotz
seiner Höhe von siebenhundertachtundachtzig Metern ganz harmlos
niedrig erscheint. Schade übrigens, daß wir in Sachsen so oft
nichtssagende Benennungen für schöne Landschaftspunkte haben.
Die Schwarte ist wirklich ein Gipfel, der mehr hält, als sein
prosaischer Name verspricht. In weiten Windungen zieht sich die
Straße nach Deutscheinsiedel am Hange empor. Immer spärlicher
werden die Häuser, nur ganz vereinzelt kleben sie unter dem kahlen
Gipfel des Schwartenberges hingeschmiegt. Links geht es ab nach
dem bekannten alten Bade Einsiedel, geradeaus führt der Weg nach
dem Zentrum der sächsischen Spielwarenerzeugung, Seiffen und
Heidelberg. Wir biegen rechts ab, um mühelos den Gipfel der
Schwarte zu erreichen, und im sonnenvergoldeten Abend stehen wir
vor einem Heimatbilde von überwältigender Weite und Größe. Unten
im Tal streben aus milchig weißen Nebeln die Türme Purschensteins
empor. Ganz leise dringt das Hämmern und Pochen des
gewerbefleißigen Neuhausen herauf, aber rundum dehnt sich das
Bild in feierlichster Stille. Dunkle Höhen, endlos, weltenweit wogend,
ruhen in feierabendlicher Verklärung so frei und gelöst, als breiteten
sie ihr Innerstes weit geöffnet dem wachenden Auge Gottes dar, und
je tiefer die Sonne sinkt, desto goldener wird das Meer der
hauchzarten Abendnebel, das die Täler erfüllt. Auf steilem Gipfel im
Westen sieht man die ferne Augustusburg als vieltürmige Silhouette
herübergrüßen, schwarz steigt der Pöhlberg weiter südlich empor,
und selbst der Fichtelberg und Keilberg zeichnen sich mit klaren
Linien in die Abendluft.
Auch nach Böhmen hinein öffnet sich weit der Blick, und woran
man vor dem Krieg, als ein befreundetes Reich sich hier weithin
erstreckte, nie dachte, das kommt einem jetzt plötzlich tief und stark
zu Bewußtsein: Grenzland ist hier, und wir stehen wie auf einer
Warte, mit deutschen Sorgen und deutschen Pflichten.
Sebnitzer Pestdenkmale
Von Prof. Dr. Alfred Meiche
Aufnahmen des Heimatschutzes

»Erzittre Welt, ich bin die Pest!


Ich komm in alle Lande
Und richte mir ein großes Fest;
Mein Blick ist Fieber, feuerfest
Und schwarz ist mein Gewande.«

Wieder einmal zog der furchtbare Würgengel im Jahre 1680 durch


Deutschland. Auch unser Sachsen ward von ihm verheert, und
schonungslos hauste er besonders im Meißner Hochlande. Nur die
Stadt Sebnitz konnte sich mit einem einzigen Todesopfer loskaufen.
Ja, es scheint sogar, als ob sich dorthin Familien aus anderen
bedrohten Orten geflüchtet hätten. Mindestens von Frau Johanna
Küffner, der Gattin eines Dresdner Ratsherrn, wissen wir, daß sie
damals aus der pestverseuchten Hauptstadt nach Sebnitz gekommen
war, weshalb die Eheleute später in ihrem letzten Willen dankbar der
dortigen Kirche und Gemeinde gedachten. Näheres über dieses
Küffnersche Legat berichtet Götzinger in seiner »Geschichte des
Amtes Hohnstein«, 1786, S. 114. Das 1702 errichtete und 1729
veröffentlichte Testament bestimmte, daß dreihundert Taler von der
legierten Summe (siebenhundert Taler) zu einem größeren Werke für
die Kirche zu verwenden seien. Als daher nur vier Jahre danach ein
Diakonat in Sebnitz geschaffen wurde, benutzte man jenes Geld zum
Bau einer Amtswohnung für den zweiten Geistlichen des Ortes. An
dem Gebäude aber wurde über der Eingangstür nach der
Straßenseite zu eine Gedächtnistafel aus Sandstein eingelassen.
Auffälligerweise erwähnt Götzinger weder die besondere
Verwendung jener dreihundert Taler noch diese Inschrift. Sie lautet,
in lateinischer Sprache und mit Initialbuchstaben geschrieben, wie
folgt:
Quod.
Oculus Os Manus
Numinis Regis Benefactoris ejusdemque
B. Dn. Johannis Sigismundi Küffneri Senat. Dresd.
Viri ob munificentiam post mortem immortalis
Dextram jungente B. conjuge ipsius
Johanna Gertrude nat. Strauchia
Providit Probabit Promovit
Cor pium senatus coetusque
Sacri Sebnitiens. aedificium
E. C. A. D. MDCCXXXIV.
Diese Schrift befindet sich auf dem ovalen, flach gewölbten
Hauptfelde der Sandsteinplatte. »Der mit Steinarabesken
umschlungene schmale Rand dieses Feldes trägt noch die
Schreibinitialen J. S. K., und gleich darunter steht auf dem
Hauptfelde in gleicher Schrift P. S. Diese fünf Buchstaben bedeuten:
Johanni Sigismundo Küffnero publico signo (Dem Johann Sigismund
Küffner zum öffentlichen Denkmal).«
Diese Inschrift dürfte auch guten Lateinern zunächst ein Rätsel
bleiben; vielleicht hat sie darum Götzinger, der Sohn des Sebnitzer
Pfarrherrn, der den »Küffnerstein« doch kennen mußte, da er zu
seiner Zeit offenbar schon bestand, in seinem Geschichtswerke
fortgelassen. Dagegen ist ihre Lösung bald hundert Jahre später
dem jetzt verstorbenen Schuldirektor Fritz Ohnesorge in Sebnitz
gelungen. Scharfsinnig verband er die in der zweiten, dritten und
achten Zeile jedesmal unvermittelt nebeneinander gestellten drei
Wörter unter sich und las nun: »Quod oculus numinis providit,
(quod) os regis probavit, (quod) manus benefactoris promovit« und
nun ergab sich folgende Übersetzung: »Dies Gebäude, das
vorhergesehen hat das Auge der Gottheit, das genehmigt hat der
Mund des Königs (von Polen und Kurfürsten von Sachsen), das
gefördert hat die Hand des Wohltäters und seligen Herrn Johann
Sigismund Küffner, Senators zu Dresden, eines wegen seiner
Wohltätigkeit nach dem Tode unsterblichen Mannes, wozu ihm die
Hand reichte seine selige Gattin Johanna Gertrud geb. Strauchin, –
das hat das fromme Herz des Stadtrats und der Kirchgemeinde zu
Sebnitz aufführen lassen im Jahre des Herrn (E. C. A. D. = exstrui
curavit anno domini) 1734.«
Ohnesorges Mitteilungen über den sogenannten Küffnerstein, die
wir hier im Auszuge wiedergeben, finden sich in der Zeitschrift des
Gebirgsvereins für die Sächsische Schweiz »Über Berg und Tal«, 5.
Jahrg. Nr. 1 (Januar 1882). Bei dem vor wenigen Jahren erfolgten
Neubau des Sebnitzer Diakonats ist der Denkstein über dem Eingang
an der nördlichen Stirnseite desselben angebracht worden, wo er
hoffentlich noch lange Zeit sinnigen Menschen das Gedächtnis an ein
edles Menschenpaar erweckt.
Zwar nicht im Kern der Stadt, aber doch in seiner Flur besitzt
Sebnitz noch ein zweites Denkmal aus jener Notzeit; das ist der
sogenannte Peststein im Gemeindehain oder wie unsere
Heimatgenossen nach der Väter Weise lieber sagen im
»Gemeenhahnel«. Auch über ihn hat Ohnesorge in derselben
Zeitschrift (4. Jahrgang Nr. 12) berichtet, und diese Darstellung zehn
Jahre später in den jetzt sehr selten gewordenen »Bergblumen«
(Dresden-Strehlen, 1891, Seite 22 f.) wiederholt. Dort ist auch ein
Bild (Federzeichnung) des Peststeins beigegeben. Beide Aufsätze
stützen sich auf eine Nachricht in dem schon erwähnten Werke
Götzingers und ein um 1880 herum noch im Besitz der Familie Odilo
Hesse in Sebnitz befindliches Protokoll vom Jahre 1817, das der
Stadtschreiber C. G. Grahl bei einem Spaziergange nach dem damals
wohl ziemlich vergessenen Denkstein aufgenommen hatte. Jene
Darstellung läßt sich nun durch Akten aus der Zeit der Pest selbst
ergänzen und in wesentlichen Punkten berichtigen[2].
Auch heute kennen selbst viele Sebnitzer dieses Denkmal nicht;
aber Rohlinge haben es doch aufzufinden gewußt und – neben den
Witterungseinflüssen – stark beschädigt (Abb. 2). Es ruft darum
nach dem Heimatschutz, entweder durch die Stadtgemeinde oder
den Landesverein selbst.
Der Peststein liegt unfern der schönen, aussichtsreichen
Staatsstraße, die von Sebnitz nach Neustadt über das Gasthaus
»Zum stillen Fritz« führt, nur wenige Minuten oberhalb der Stelle, wo
beim Sebnitzer hinteren Finkengute die Eisenbahn den Straßenzug
überbrückt, und zwar in einem halbhohen Fichtenwald nordöstlich
der Straße. Seine Lage hat bisher eine gute photographische
Aufnahme vereitelt.
Der Denkstein besteht aus einer Sandsteinplatte mit Inschrift;
erstere ist an einem großen Granitblock von fünf bis sechs Meter
Länge und etwa drei Meter Breite und Höhe angebracht. Vor seinem
Ostfuße bemerkt man den flachen Grabhügel, dessen Kopfseite noch
ein roher, mit dem Kreuzeszeichen versehener kleiner Granitstein
bezeichnet. Von den vier Weimutskiefern, die einst das Grab an
seinen Ecken umhegten, steht nur noch eine.
Abb. 1. Nebeneingang zum Diakonat in Sebnitz mit
dem Küffnerstein
Errichtet wurde dieses Denkmal 1740. Die im obenerwähnten
Protokoll genannte Zeit 1746 beruht auf einem Lesefehler. Erneuert
wurde es 1835. Nach den genannten Quellen ruht hier Frau Maria
Wunderlich geb. Schuster, aus dem Erbgericht zu Rugiswalde
stammend, Ehefrau des Bürgers und Schneiders Johann Wunderlich
in Sebnitz. Mit ihrem volkstümlichen Namen hieß sie die Toffels
Hansin. Sie war in dem schweren Pestjahre 1680 – die Überlieferung
sagt: entweder zum Besuch ihrer Mutter oder um dort Butter zu
holen – nach Rugiswalde gegangen, wo die Pest stark wütete. Als
man das in Sebnitz erfuhr, sollen ihr die dortigen Einwohner mit
Stangen bewaffnet entgegengezogen sein, ihr die Rückkehr in die
Stadt verwehrt und ihr an der bezeichneten Stelle eine Hütte gebaut
haben, wohin ihr täglich Speise und Trank gebracht wurde. In
meinen Kinderjahren haben mir alte Sebnitzer noch den
sogenannten Pestweg gezeigt, der von der Hertigswalder Straße
durch das Grundstück des oben genannten Odilo Hesse (worin sich
jetzt das Gewerkschaftsheim befindet) über die sogenannte
Drehbrücke, dann durch das Grundstück der Lampenfabrik (ehemals
Hoffmann, jetzt Schwager) am Nordostrande des »Knöchels«
emporsteigend, an Feld-Oppelts Hause und einem alten (jetzt
abgehauenen) wilden Apfelbaume (dicht am heutigen
Krankenhause) vorüber nach dem sogenannten Hemmhübel geführt
haben soll. Demnach müßte also die Familie im Südostviertel der
Stadt, auf der Retschiene oder Hertigswalder Straße, gewohnt
haben.
Die unglückliche Frau soll nun neunzehn Wochen lang allein in der
Waldeinsamkeit gehaust haben und im Alter von einunddreißig
Jahren drei Monaten am 24. August 1680 dort gestorben sein. Das
Sebnitzer Kirchenbuch enthält merkwürdigerweise keinen Eintrag
ihres Todes.
Wenn diese Darstellung zutreffend wäre, so hätte Direktor
Ohnesorge allen Grund gehabt, zu bezweifeln, daß die Toffels Hansin
an der Pest gestorben sei, die ihre Opfer bekanntlich nach wenigen
Tagen hinzuraffen pflegt. Man müßte dann ihren Tod vielmehr »den
Unbilden der Witterung, dem Mangel an Pflege und dem Bangen und
Sorgen ihres Herzens« zuschreiben und »den törichten Wahn der
Menschen, ihre selbstsüchtige Furcht vor Ansteckung« dafür
verantwortlich machen.
Nun klärt uns aber ein zufälliger Aktenfund, den ich im
Sächsischen Hauptstaatsarchiv (Locat 9961. Volumen I. Contagion-
und Todenberichte. 1680. 1681.) machte, über den Fall auf, der
dadurch ein wesentlich anderes Aussehen bekommt. In diesem aus
den Tagen der Pest selbst stammenden Aktenstück (26. September
1680) des Hohnsteiner Amtsschössers Joh. Gottfried Hanitzsch heißt
es nämlich: »Es sind von der Contagion ergriffen und verstorben: in
dem Ambts- und Grentz-Städtlein Sebnitz – Ein Hausz – Wunderlich,
– Eine Persohn, als deszen Weib, so alsbaldt aus dem Hause und
dem Städtlein geschaffet und den 17. Augusti im Felde verstorben.
Und ist es bey dieser einzigen Persohn und Hausz bis zur Zeit
verblieben.« Nur zwei Tage später (28. September) gibt derselbe
Beamte den folgenden eingehenderen Bericht: »Das Ambtt- und
Grentz-Städtlein Sebnitz, In selbigem ist nach Ausweisung meines
sub dato den 30. Augusti eingesendeten unterthänigsten Bericht bey
einem Bürger, Hannsz Wunderlichen, die Contagion zwart
eingeschlichen gewesen. Nachdem aber derselbe alsbald nebst
seinem daran krank gelegenen Weibe und Kindern aus dem Städtlein
geschaffet worden, ist es Gott sey Dank nicht weiter kommen, auch
nurt daran Eine Person, als besagten Wunderlichs Weib, allein im
Felde verstorben, der Mann aber nebst denen Kindern auszer dem
kleinsten (welches in die Acht wochen am Fieber gelegen) befinden
sich in ihrer Hütten, darinnen sie sich nunmehr sechs Wochen
aufgehalten, annoch gesundt; ist also dem Höchsten sey Dannk
dieser gänzlichen restituirt und von dieser bösen Seuche,
befreyhet«.
Abb. 2. Sebnitzer Peststein

Aus diesen durchaus zuverlässigen Unterlagen folgt:


1. Die dramatische Szene von der stangenbewaffneten
Volksmenge, die der Frau den Zutritt zur Stadt verwehrte, ist eine
sagenhafte Zutat späterer Zeit. Vielmehr hat man die
pestverdächtige Person aus ihrer Wohnung in den Wald gebracht.
2. Die Kranke hauste in ihrer Hütte nicht allein, sondern ihre ganze
Familie teilte diesen Aufenthaltsort. Daß man den Ausgesetzten auf
dem Pestwege Speisen zutrug und ihnen diese mit langen Stangen
zureichte (wie mir schon vor fünfundvierzig Jahren alte Leute
erzählten), ist sehr wahrscheinlich und hat vielleicht den Anlaß zu
dem Gerüchte von der gewaltsamen Abwehr der kranken Frau
gegeben.
3. Das Sterbedatum auf der Gedächtnistafel (24. August) ist
falsch. Der Todestag war vielmehr der 17. August 1680. (Auch unter
diesem Datum ist allerdings ihr Tod im Sebnitzer Kirchenbuch nicht
vermerkt; wahrscheinlich weil die Frau ohne geistliche Mitwirkung
bestattet worden war.)
4. Es bleibt noch immer fraglich, ob die Toffels Hansin wirklich an
der Pest gestorben ist, da wir den Tag ihrer Erkrankung nicht
kennen, ihre Familie trotz des langen, engen Zusammenlebens
gesund geblieben ist und die acht Wochen währende Krankheit des
jüngsten Kindes auch nicht gerade auf die indische Beulenpest
schließen läßt.
5. Ebenso wird es unwahrscheinlich, daß die Überlebenden
wirklich neunzehn Wochen im Walde zugebracht haben. Da sie aber
mindestens sechs Wochen, vom Todestage der Frau (17. August) bis
zum Berichtstage (28. September) dort hausten, hat ihre
Verbannung doch recht lange gewährt. Beruhigen wir uns bei dem
Gedanken, daß sie in den Hochsommer fiel, wo das Leben im Walde
immerhin erträglich war.
Nach alledem aber erscheint uns das Verhalten der Sebnitzer
Einwohner in wesentlich milderem Lichte.
Und in jedem Falle würde die Furcht der Gemeinde vor dem
grausamen Würgengel bei dem Fehlen anderer sanitärer
Vorbeugungsmittel wohl begreiflich sein. Richtete doch die Pest in
nächster Nähe der Stadt entsetzliche Verheerungen an. Der hier
benutzte Bericht meldet zugleich, daß der Seuche damals im
benachbarten Neustadt hundertsiebenunddreißig Personen, nämlich
fünfundzwanzig Ehemänner, sechsundzwanzig Eheweiber,
dreiundsechzig Kinder, fünfzehn Witweiber, acht Mägde, und
unverehelichte Personen, – in Langburkersdorf neunundzwanzig, in
Krumhermsdorf acht, in Rugiswalde aber, der Heimat der Frau
Wunderlich, dreiundzwanzig Personen zum Opfer fielen.
Daß sich Sebnitz übrigens nicht allzu ängstlich von der Außenwelt
abschloß, beweist schon die Aufnahme der anfangs erwähnten
Familie Küffner aus dem pestverseuchten Dresden.
Das Geschlecht von heute, das sich nun schon seit Jahren von
schweren Volkskrankheiten aller Art bedroht sieht, mag wohl mit
ernsten Gedanken zu jener Ruhestätte pilgern, die das
glücklicherweise einzige Opfer jener gleichfalls schweren Zeit
umschließt. Es sollte aber auch pietätvoll das schlichte Denkmal
schützen, das Kindesliebe (ein Sohn der Toffels Hansin, der spätere
Bürgermeister Johann Friedrich Wunderlich zu Sebnitz) der Mutter
draußen im freien Waldesrauschen errichtet hat. – Bei einer
Auffrischung oder Erneuerung müßte natürlich der Wortlaut der
Inschrift den Tatsachen gemäß berichtigt werden.

Fußnote:
[2] (Vgl. Sebnitzer Grenzblatt 1920, Nr. 153.)
Die deutschen Jugendherbergen
Von Günther Lamm, Dresden
Eine der Zeitschriften, die der Briefträger mir ins Haus bringt,
heißt: »Die Jugendherberge«. Gerade diese lese ich neben den –
Heimatschutzmitteilungen besonders gern. Mit politischen,
philosophischen oder religiösen Problemen »beschäftigt« sie sich
ganz und gar nicht; aber Natur und Jugend, Freude und Leben,
Wandern und Heimat, das sind Worte, die man oft darin, selbst im
»praktischen« Teile, finden kann. »Die Jugendherberge« ist die
Zeitschrift des Verbandes für deutsche Jugendherbergen.
Das Ziel der edelsten Bestrebungen der heutigen Zeit ist
Erneuerung und Gesundung unseres an Leib wie Seele erkrankten
Volkes. Dieses Bestreben liegt zum Beispiel in der Heimatschutz- als
auch in der Wanderbewegung. – Wandern und Heimat! – Wer hört
nicht den frischen Klang aus so manchem Volksliede singen! Denn
gerade das Wandern liegt den Deutschen im Blute. Dieser naturhafte
Drang, der durch die Entwicklung der Verhältnisse stark
zurückgehalten worden ist, soll zum Heile des Volkes wieder erweckt
werden; daß man damit am Anfange anfängt, das heißt in diesem
Falle bei dem heranwachsenden Geschlechte, ist selbstverständlich.
Doch da stellen sich Bedenken ein: In Deutschland kostet ja
Wandern heutzutage viel Geld! Wer von den jungen Leuten hat aber
welches? Vorwiegend durch das Gasthaus mit dem notwendigen
Übernachten wird das Reisen verteuert. Daher hat man lange vor
dem Kriege schon begonnen, diese Not durch das Schaffen der
deutschen Jugendherbergen zu beseitigen. Erst durch diese Tat
werden die Ziele des Verbandes ermöglicht: »Die frühzeitige und
regelmäßige Hinkehr zur Natur, von der Volksschule an, ist das beste
Bollwerk gegen Tuberkulose und Alkohol, gegen Verschwendungs-
und Vergnügungssucht, gegen Kino und Zigarette, gegen
Modesklaverei und Verweichlichung bei Jungen und Mädchen, der
sicherste Weg zu Einfachheit und Selbständigkeit, zu Arbeitskraft und
Arbeitslust, zu reiner Freude und Volksgesundheit, zur Heranziehung
eines sportfreudigen Geschlechts. Die Herbergen sollen das
Jugendwandern ermöglichen. Hinter dem Herbergswerk stehen mit
seltener Einmütigkeit alle Schichten von rechts bis links, arm und
reich. Es geht jeden an, den Vater für seinen Sohn, den Arbeitgeber
für seine schaffenden Kräfte, die Gemeinden für ihren
Nachwuchs. –« In den Richtlinien für deutsche Jugendherbergen
heißt es: »Die Jugendherbergen sollen auf gemeinnütziger
Grundlage der gesamten wandernden Jugend nach des Tages Mühe
eine einfache, möglichst billige Übernachtungsgelegenheit als
Grundlage für mehrtägiges Wandern bieten. Das werdende
Reichsherbergsnetz soll ein allgemeines Jugendwandern
ermöglichen. Wandergebiet ist überall, auch im Flachland. Auch Rad-
und Bootwanderer sowie Schneeläufer sind willkommen. – Es gilt,
das heranwachsende Geschlecht frühzeitig in lebendige Fühlung mit
der Mutter Natur zu bringen. Durch die Jugendherbergen soll ihm
Gelegenheit gegeben werden, Heimat und Vaterland aus eigener
Anschauung kennen und liebgewinnen zu lernen zur Förderung des
leiblichen und sittlichen Gedeihens, zur Hebung der Jugendkraft und
Volksgesundheit, zur Aneignung frohen Lebensmutes. Die Herbergen
sollen sich in den Dienst der Volksverschmelzung und Verwischung
der Standesunterschiede, der Heranbildung eines wirklich einigen
deutschen Volkes stellen.«
In allen deutschen Gauen befinden sich Zweigausschüsse des
Verbandes. Für Sachsen ist einer in Dresden tätig. Er wird durch die
Arbeit von dreißig Ortsgruppen unterstützt, denen unmittelbar die
Sorge für die in ihrem Bereiche bestehenden Herbergen obliegt.
Zurzeit gibt es unter den zweitausenddreihundert Herbergen etwa
hundertdreißig sächsische. Auffallend wenige sind in Nordsachsen zu
finden. Es sei bemerkt, daß es überhaupt notwendig ist, noch viele
Herbergen zu errichten und die vorhandenen weiter auszubauen.
Zum Erreichen der Ziele sind unbedingt zehntausend deutsche
Herbergen erforderlich. Starker Unterstützung bedarf das große
Werk!
Die Arbeit an den Jugendherbergen gerade in unserem
Sachsenlande wird jetzt gekrönt durch die Übernahme der Burg
Hohnstein in der Sächsischen Schweiz als »Jugendburg«. Sie soll
nicht nur Herberge sein, sondern eine sichere Burg, in derem
Schutze sich das heranwachsende Geschlecht bilden und Feste feiern
kann. Letzten Endes wird Heimat der Boden dieser Bildung sein und
Heimat den Hintergrund der Feste bilden. Alles Nähere über
Hohnstein ist in einem besonderen Heftchen wie auch aus dem
»Sächsischen Jugendwanderdienst«, dem Mitteilungsblatte des
Zweigausschusses, zu ersehen.
Ihr jungen Sachsen! Durch die Jugendherbergen ist es nunmehr
möglich, selbst mit bescheidenen Geldmitteln eure sächsische
Heimat kennenzulernen, vom Vogtlande bis hinüber zur Lausitz, vom
Tieflande im Norden bis hinauf zum Gipfel des Fichtelberges!
Jedem wird klar sein, daß hierdurch auch die
Heimatschutzbewegung eine kräftige Unterstützung findet; lernt
doch niemand seine Heimat besser kennen und lieben als der, der
sie sich in eigener Anschauung erwandert. Noch aber ist es
notwendig, wozu der Herbergsverband in einem Aufrufe ermahnt:
»Schont Wiesen und Felder, Wald und Strauch! Denn heilig ist das
Land und alles, was es trägt.« – Daß dieses bald selbstverständlich
sei, dazu helfe uns Heimatschutz und Jugendherberge! Deshalb:
Werdet Mitstreiter am großen Werke!
Die Reise nach Sylt
Eine Elbfahrt von Edgar Hahnewald
Mir war es, als wäre ich durch ein Traumland gezogen, ein
Traumland, das auf unserer ruhigen Erde keinen Raum hat, von dem
einem zarte duftige Bilder vor der Seele stehenbleiben als stille
Erinnerungen.
Im rüttelnden Eisenbahnwagen habe ich einen großen Teil dieser
Bilder an meiner Seele vorüberziehen lassen und habe alle Unruhe
vergessen, den Lärm nicht mehr gehört, sondern ich war entrückt
auf einen großen Elbkahn und schwamm die Elbe abwärts, hörte das
Wasser gurgeln, raunen, strömen und plätschern, roch den
Teergeruch und sah in ewig wechselnder Beleuchtung die
auftauchenden und vorübergleitenden Bilder der Stromufer mit ihren
Dörfern und Städten, mit ihren Wiesen und Bäumen und Menschen.
Hamburg, die Weltstadt, empfängt uns mit ihren brausenden
Akkorden, mit dem gewaltigen Rhythmus ihrer Arbeit und ihrem
weltumspannenden Handelsgeist.
Dann sind wir auf Sylt. Nicht das Sylt der Modebäder, der Saison!
Nein, das Sylt einsamer Dünen, der rollenden, nagenden Brandung,
der rauschenden See, stiller, stolzer, einsamer Menschen, des
schimmernden Watts, blauender Himmelsweiten und Wolken, das
Sylt, auf dem man im Kommen und Gehen der Wogen, im Wehen
und Rieseln des Dünensandes sein eigenes, kleines, unruhiges Ich
verliert und als Kind der Allmutter Natur Jahrtausende atmen hört;
auf Sylt, der blonden Insel zwischen zwei Meeren.
Wie Hahnewald seine Schilderung beginnt: »Schweres Poltern und
Klirren weckte mich,« so riß mich aus dem Traumland seiner
wundersamen Bilder und farbenschimmernden Schilderungen das
Klirren und Poltern des an meinem Ziele haltenden Zuges. »Wieder
hat sich eine Tür hinter mir geschlossen,« schließt er sein Buch,
»eine Tür, vor der ich manchmal stehen werde voller Sehnsucht:
Dahinter liegt Sylt, die blonde Insel zwischen zwei Meeren.«
Eins weiß ich gewiß: Die Tür zu den Fahrten der Sehnsucht,
welche er in seinem Buche geöffnet hat, werde ich noch öfter im
Geiste durchschreiten. Nicht spannende Abenteuer oder pikante
Reiseerlebnisse sind es, die erschlossen werden, nein, stilles
deutsches Land, deutsches Fühlen, deutsche Heimat, innig und tief
ergriffen und geschaut und darum in aller Schlichtheit stille
ergreifend.
Das Büchlein ist geschmückt mit Abbildungen nach alten
Stahlstichen, Steindrucken und Zeichnungen, die fein in das
sozusagen zeitlose Erleben des Buches hineinpassen. Heimaterleben
in tiefster Seele, das kann das Büchlein dich lehren und dir
schenken. Still und froh wird es dich machen und dir Sehnsucht ins
Herz geben. »Sehne dich und wandere.«
Rieß-Freiberg.
Verlag Carl Schünemann, Bremen. Preis broschürt 2.50 RM.
Wieder einmal: Reklameschilder
Daß jetzt jede Möglichkeit zum Reklamemachen von Handel und
Industrie ausgenutzt wird, mag in diesen Zeiten wirtschaftlichen
Tiefstandes seine Begründung und Entschuldigung finden. Aber
immerhin sollten dabei nicht Werte aufs Spiel gesetzt werden, die
durch schlechte oder unangebrachte Plakate vernichtet werden und
weit mehr bedeuten, als alle Reklameschilder samt und sonders
einbringen. Ein wahrer Tummelplatz für Geschmack- und
Verständnislosigkeiten dieser Art ist neuerdings das Gelände rechts
und links der Bahn geworden. Es sei von vornherein zugegeben, daß
einmal in der Nähe von Eisenbahnstrecken selten etwas
landschaftlich oder volkskundlich Wertvolles zu verderben ist, und
daß andererseits gut ausgeführte Reklameschilder an dafür
passenden Stellen keineswegs einen unangenehmen Eindruck
machen. Ich denke dabei etwa an die Schilder, die an der Dresdner
Rennbahn zwischen den Stationen Reick und Niedersedlitz errichtet
worden sind; da ist von keinem Standpunkt aus etwas dagegen
einzuwenden. Aber so findet man es leider nicht immer. Die
schlechtesten Schilder finden sich oft an den landschaftlich
schönsten Punkten.
Eine wahre Epidemie dieser Art scheint das Dorf Seeligstadt
ergriffen zu haben, daß der von Dresden nach Görlitz zu Reisende
zwischen Arnsdorf und Großharthau linker Hand liegen sieht. Zwar
hat dieser Ort seinen dörflichen Charakter nicht mehr ganz rein
gewahrt; eine Dampfesse zeigt den bereits geschehenen Einzug der
Industrie an. Aber trotzdem findet man noch schöne Güter unter
alten Linden und Eichen versteckt, und niedliche Bauernhäuser mit
Strohdach und Balkenumgebinde träumen am plätschernden,
gänsebelebten Wasser, freilich mit böse nach den häßlichen
Neubauten an der Straße blickenden Fenstern. Immerhin zeigte das
Dorf noch im Sommer 1923 über blinkende Teiche hinweg dem
vorbeieilenden Reisenden ein ländliches, beschauliches Bild. –
Aber seit dem letzten Frühjahr ist dieser Friede grausam gestört
worden. An einem großen Gute, dessen Scheunengiebel mit breiter
Auffahrt und prächtiger alter Linde nach der Bahn herüberschaut,
haben sich nicht weniger als vier große, schreiende Plakate breit
gemacht. Likör, Stiefelwichse und Nähmaschinen werden
angepriesen neben einer Aufforderung, die Breslauer Messe zu
besuchen – Schilder wie das letztere, das doch über kurz oder lang
zwecklos ist, bedeuten auch reklametechnisch eine vollständige
Verirrung.
Dieses böse, auch im Bilde vorgeführte Beispiel hat leider Schule
gemacht. Eine kleine Wirtschaft nebenan beeilt sich schon,
denselben Schnaps noch einmal anzubieten. Dasselbe war an einem
niedlichen alten Strohhaus der Fall, das allerdings in diesem Sommer
einem schmucklosen Neubau gewichen ist. Sein Besitzer versicherte
mir aber, daß er nie und nimmermehr sein neues Haus mit diesen
häßlichen Schildern verunzieren wolle. Eine einzelne Scheune
jenseits der Bahn trägt auch ein ganzes Sortiment derartiger
Plakate; da hier aber nichts landschaftlich Wertvolles zu verderben
ist, wenigstens nicht von der Bahn aus gesehen – vom Dorf aus wird
die Scheune durch Bäume verdeckt – so soll dagegen hier nichts
gesagt sein. –
Diese Reklamepest wäre verständlich, wenn die Besitzer einen
wesentlichen, ins Gewicht fallenden Nutzen davon hätten. Aber das
ist nicht der Fall; denn eine Mark fünfzig pro Schild und Jahr sind
keine Summe, die die Schädigungen des Landschaftsbildes auch nur
teilweise rechtfertigt. Da sich anscheinend gesetzlich auch nicht mit
der nötigen Bestimmtheit durchdrücken läßt, so hilft eben nur eine
eindringliche Aufklärung der Bewohnerschaft in diesen
»gefährdeten« Orten, die dazu erzogen werden müßte, den
Angeboten der Plakatreisenden gegenüber sich fest ablehnend zu
verhalten.
Mögen diese Zeilen zum Kampf um die Schönheit unserer Heimat
beitragen!

Anmerkung der Schriftleitung: Die Erzählung »War sich a Kuh kaafn will, muß
erscht in Schtall hom« (Heft 11/12, Bd. XIII) ist nicht von Paul Meile, Lugau,
verfaßt, sondern ist der Abdruck der im Jahre 1883 erschienenen Erzählung »Der
Nußknacker« von R. Hubert, Leipzig (Jahrbuch »Glückauf« 1884).
Für die Schriftleitung des Textes verantwortlich: Werner Schmidt – Druck:
Lehmannsche Buchdruckerei
Klischees von Römmler & Jonas, sämtlich in Dresden

You might also like