VBScript Introduction

Course description

Overview: Students will learn to use or create VBScript variables, arithmetic and logical operators, built-in and custom functions, and conditional statements and loops, as well as understand variant sub-types.

Prerequisites: A working knowledge of advanced-level HTML. Programming experience is helpful, but not required.

Performance-based objectives

Lesson objectives help students become comfortable with the course, and also provide a means to evaluate learning. Upon successful completion of this course, students will be able to:

*           Define VBScript and describe the advantages of using it in Web pages.

*           Embed VBScript code in an HTML document, hide the VBScript code from browsers that lack a VBScript interpreter, and insert comments into VBScript code.

*           Define variables, name them appropriately, and demonstrate implicit and explicit declarations of variables.

*           Declare arrays and use them in scripts.

*           Use the four types of VBScript operators and produce specific results by demonstrating their precedence.

*           Insert functions, subroutines, and Event Procedures into VBScripts and reduce programming effort by using VBScript’s predefined procedures.

*           Write code that makes decisions based on existing conditions using control structures and loops.

*           Format numbers and manipulate the variant subtype String, using some predefined functions.

*           Enable communication with Web page visitors using Message and Input boxes.

*           Extract date and time information from the client computer, format it, and display the date and time of the last update on the Web page.

*           Use the DOM to control the layout of HTML pages, add effects, and get information from users.

*           Use functions to handle Windows mouse and keyboard events, validate user input, and handle run-time errors.

Course content

Lesson 1: VBScript & the Web

VBScript Popularity

VBScript Defined

Platform or Host Dependence

Scripting Languages

Lesson 2: VBScript Basics

Embedding VBScript in HTML

VBScript to Display Information

Hiding VBScript from Older Browsers

Code Documentation & Formatting

Lesson 3: Variables, subtypes & Constants

Variable Defined

Declaring Variables

Naming Variables

Variants & Subtypes

Assigning Values to Variables

Determining Variant Subtype

Data Subtype Conversion

Numeric & Literal Constants

Lesson 4: Arrays

Groups of Similar Variables

One-Dimensional Arrays

Multi-Dimensional Arrays

Lesson 5: VBScript Operators

VBScript Operators

Arithmetic Operator Precedence

Comparison Operators

Logic Operators

String Concatenation

Lesson 6: VBScript Procedures

Procedures

Subroutine Procedures

Scope of Variables

Function Procedures

Randomize & RND

Lesson 7: Program Control & Structure

Control Statements

Four Control Structures

Using Loops

Topic title

Lesson 8: Strings & Numbers

Strings

Formatting Numbers

Lesson 9: Message & Input Boxes

Message Box

Input Boxes

Lesson 10: Dates & Times

Dates & Times

Splitting Up Dates & Times

Page Updates

Lesson 11: The Document Object Model

What Does VBScript Manipulate?

History & Background of the DOM

Properties, Methods, Events & Collections

Internet Explorer 5.x DOM

Lesson 12: Event Handlers

Top-Down vs. Event-Driven Programming

Mouse Events

Keyboard Events

Validation & Error Handling