Visual Basic Quickstart Guide

Book description

Master software development with Visual Basic, from core concepts to real-world applications, with this comprehensive guide

Key Features

  • Acquire a solid understanding of object-oriented programming (OOP) principles, such as inheritance and polymorphism
  • Develop expertise in maintaining legacy code with increased efficiency
  • Learn to read, write, and differentiate between VB Script, VBA, VB Classic, and VB.NET Code
  • Purchase of the print or Kindle book includes a free PDF eBook

Book Description

Whether you’re an absolute beginner or an experienced developer looking to learn the Visual Basic language, this book takes a hands-on approach to guide you through the process. From the very first chapters, you'll delve into writing programs, exploring core concepts such as data types, decision branching, and iteration. Additionally, you’ll get to grips with working with data structures, file I/O, and essential object-oriented principles like inheritance and polymorphism.

This book goes beyond the basics to equip you with the skills to read and write code across the entire VB family, spanning VB Script, VBA, VB Classic, and VB.NET, enabling you to handle legacy code maintenance with ease.

With clear explanations, practical examples, and hands-on exercises, this book empowers you to tackle real-world software development tasks, whether you're enhancing existing projects or embarking on new ones. It addresses common challenges like distinguishing between the variations of the VB programming language to help you choose the right one for your projects.

Don't let VB's extensive legacy daunt you; embrace it with this comprehensive guide that equips you with practical, up-to-date coding skills to overcome the challenges presented by Visual Basic's rich history of over two decades.

What you will learn

  • Acquire a solid understanding of object-oriented programming (OOP) principles, such as inheritance and polymorphism
  • Develop expertise in maintaining legacy code with increased efficiency
  • Learn to read, write, and differentiate between Visual Baic Script, Visual Baic for Applications, Visual Baic Classic, and VB.NET Code
  • Purchase of the print or Kindle book includes a free PDF e-book

Who this book is for

If you’re a software developer or web developer either already engaged in or aspiring to be involved in maintaining, enhancing, administering, and defending visual basic programs, websites, and scripts, this book is for you. It's an excellent resource for beginners in software development who want to learn Visual Basic from scratch.

Table of contents

  1. Visual Basic Quick Start Guide
  2. Contributors
  3. About the author
  4. About the reviewer
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Conventions used
    6. Get in touch
    7. Share your thoughts
    8. Download a free PDF copy of this book
  6. Part 1:Visual Basic Programming and Scripting
  7. Chapter 1: The Visual Basic Family of Programming Languages
    1. Technical requirements
    2. Programming with Visual Basic.NET Windows Forms
      1. Hello, World! in Visual Basic.NET Windows Forms
      2. Installing Visual Basic.NET
      3. Alternative installations of Visual Basic.NET
      4. Coding Visual Basic.NET Windows Forms Hello, World!
    3. Programming with Visual Basic Classic
      1. Hello, World! in Visual Basic Classic
      2. Installing Visual Basic 6
      3. Alternative installations
      4. Running the Visual Basic 6 Hello, World! program
    4. Programming with VBA
      1. Hello, World! in VBA
      2. Coding a VBA Hello, World! from Excel
    5. Programming with VBScript
      1. Hello, World! in VBScript
      2. Coding a Hello, World! VBScript with Notepad
    6. Programming with Classic ASP
      1. Hello, World! in Classic ASP
      2. Installing Classic ASP on Windows
      3. Alternative installations
      4. Coding Classic ASP Hello, World! with Notepad
    7. Programming in ASP.NET
      1. Hello, World! in ASP.NET
      2. Installing ASP.NET
      3. Alternative installations
      4. Coding ASP.NET Hello, World! with Visual Studio
    8. Summary
  8. Chapter 2: Console Input and Output
    1. Technical requirements
    2. Programming input and output with Visual Basic.NET
      1. Simple interaction in Visual Basic.NET
      2. Coding a simple interaction in Visual Basic.NET
    3. Programming input and output with Visual Basic Classic
      1. Simple interaction in Visual Basic Classic
      2. Coding a simple interaction in Visual Basic 6
    4. Programming input and output with VBA
      1. Simple interaction in VBA
      2. Coding a simple interaction with VBA in Excel
    5. Programming input and output with Visual Basic Script
      1. Simple interaction in VBScript
      2. Coding a simple interaction in VBScript with Notepad
    6. Programming input and output with Classic ASP
      1. Simple interaction in Classic ASP
      2. Coding a simple interaction in Classic ASP with Notepad
    7. Programming input and output with ASP.NET
      1. Simple interaction in ASP.NET
      2. Coding a simple interaction in ASP.NET with Visual Studio
    8. Summary
  9. Chapter 3: Data Types and Variables
    1. Choosing data types
      1. Implicit versus explicit variable declaration
      2. Exploring the Option Explicit statement
    2. Understanding variable scope
    3. Best practices – naming variables
    4. Storing more than one value
    5. Differences in data types between family members
      1. Differences in data types between VBScript and VB6
      2. Differences in data types between VBA and VB6
      3. Differences in data types between VB6 and VB.NET
    6. Summary
  10. Chapter 4: Decision Branching
    1. If statements
    2. Case statements
    3. Ternary operators
    4. The VB.NET OrElse operator
    5. The VB.NET AndAlso operator
    6. The GoTo statement
    7. Summary
  11. Chapter 5: Iteration
    1. For loops
    2. While loops
    3. Do loops
    4. Exit and Continue statements
    5. Infinite loops
    6. Summary
  12. Chapter 6: Functions and Procedures
    1. Modularizing code in functions
    2. Modularizing code in procedures
    3. Understanding parameters in functions and procedures
    4. Return statement
    5. Summary
  13. Chapter 7: Project Part I
    1. Technical requirements
    2. Building the project in the VB.NET console
      1. Coding a Visual Basic.NET console calculator
    3. Building the project in VB6
      1. Coding a Visual Basic 6 calculator
    4. Building the project in VBA
      1. Coding a VBA calculator in Excel
    5. Building the project in VBScript
      1. Coding a VBScript calculator with Notepad
    6. Building the project in Classic ASP
      1. Coding a Classic ASP calculator with Notepad
    7. Building the project in ASP.NET
      1. Coding an ASP.NET calculator with Visual Studio
    8. Summary
  14. Part 2:Visual Basic Files and Data Structures
  15. Chapter 8: Formatting and Modifying Data
    1. Modifying string data
      1. Concatenation
      2. Substring extraction
      3. String replacement
      4. Case conversion
    2. Modifying numerical data
      1. Mathematical operations
      2. Rounding and truncation
      3. Type conversion
    3. Modifying date and time data
      1. Creating date and time values
      2. Date and time math
      3. Date and time component extraction
      4. Formatting numeric values
      5. Formatting date and time values
    4. Summary
  16. Chapter 9: File Input and Output
    1. Working with directories and files
      1. Working with files in VB.NET
      2. Working with directories in VB.NET
      3. Working with files in older VB family members
      4. Working with directories in older VB family members
    2. Writing test into files
      1. Writing text in VB6 and VBA
    3. Reading text from files
      1. Reading text in VB6 and VBA
    4. Writing binary data to files
      1. Writing binary data in VB6 and VBA
    5. Reading binary data from files
      1. Reading binary data in VB6 and VBA
    6. Summary
  17. Chapter 10: Collections
    1. Working with one-dimensional arrays
    2. Utilizing multidimensional arrays
      1. Handling arrays in early VB family members
    3. When and how to use lists
    4. Storing data in a dictionary
    5. Summary
  18. Chapter 11: Project Part II
    1. Technical requirements
    2. Building the project in the VB.NET console
      1. Coding the VB.NET console grading tool
    3. Building the project in VB6
      1. Coding the VB 6 grading tool
    4. Building the project in VBA
      1. Coding the VBA grading tool in Excel
    5. Building the project in VBScript
      1. Coding the VBScript grading tool with Notepad
    6. Building the project in Classic ASP
      1. Coding the Classic ASP grading tool with Notepad
    7. Building the project in ASP.NET
      1. Coding the ASP.NET calculator with Visual Studio
    8. Summary
  19. Part 3:Object-Oriented Visual Basic
  20. Chapter 12: Object-Oriented Programming
    1. Classes and fields
      1. Class declaration
      2. Fields
    2. Methods
      1. Method declaration
    3. Instantiating a class
    4. One-to-one has-a relationships
    5. Summary
  21. Chapter 13: Inheritance
    1. Inheritance in VB.NET
    2. Inheritance differences in family members
      1. VB6/VBA
      2. VB.NET
    3. Exception handling
    4. Is-a relationships
    5. Summary
  22. Chapter 14: Polymorphism
    1. Polymorphism
    2. Abstract classes
    3. Sealed classes
    4. Summary
  23. Chapter 15: Interfaces
    1. Interfaces
    2. Developing interfaces
      1. Interface declaration
      2. Implementing an interface
      3. Using interface polymorphism
    3. Standard interfaces
    4. Summary
  24. Chapter 16: Project Part III
    1. Technical requirements
    2. Building the project in the VB.NET console
    3. Coding the Visual Basic.NET console grading tool
    4. Building the project in ASP.NET
    5. Coding an ASP.NET calculator with Visual Studio
    6. Summary
  25. Part 4:Server-Side Development
  26. Chapter 17: The Request and Response Model
    1. Classic ASP Request object
    2. ASP.NET Request object
    3. Classic ASP Response object
    4. ASP.NET Response object
    5. Summary
  27. Chapter 18: Variable Scope and Concurrency
    1. Session scope
    2. Application scope
    3. Request scope and cookies
      1. Request scope in ASP
      2. Cookies in ASP
    4. Summary
  28. Chapter 19: Project Part IV
    1. Technical requirements
    2. Building the project in Classic ASP
      1. Coding the Classic ASP grading tool with Notepad
    3. Building the project in ASP.NET
      1. Coding the ASP.NET server-side grade averager with Visual Studio
    4. Summary
  29. Chapter 20: Conclusions
    1. Summing it all up
      1. Variable declaration
      2. Data types
      3. Scope
      4. Decision branching
      5. Procedure modularization
      6. Collections
      7. File handling
      8. Object encapsulation
      9. Inheritance
      10. Polymorphism
      11. Web application HTTP model and concurrency
    2. Further reading topics
      1. VB6 form development
      2. VB.NET WinForms development
      3. COM object creation
    3. Suggested projects
    4. Summary
  30. Index
    1. Why subscribe?
  31. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: Visual Basic Quickstart Guide
  • Author(s): Aspen Olmsted
  • Release date: October 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781805125310