VBScript Examples

Basics

Write Text with VBScript

Format Text with HTML Tags

Functions in the head Section

Scripts in the body Section

Variables

Create a Variable

Insert Variable Values into Text

Create an Array

Procedures

Sub Procedures

Function Procedures

Conditional Statements

If...Then...Else Statement

If...Then...ElseIf Statement

Select Case Statement

Random Link

Loops

For...Next Loop

Loop to Output HTML Headings

For...Each Loop

Do...While Loop

Date and Time Functions

Display Date and Time

Display the Day of the Week

Display the Month

Display the Current Month and Day of the Week

Count Down Seconds to the Year 3000

Add a Time Interval to a Date

Format Date and Time

Is This a Date?

Other Built-in Functions

Uppercase or Lowercase Character?

Remove Spaces from the Ends of a String

Reverse the Order of Characters

Convert a Number to an Integer

Return a Random Number

Return a Random Number Between 0 and 99

Return a Specified Number of Characters from the Left or Right of a String

Replace Certain Characters in a String

Return a Specified Number of Characters from a String

Other Extensions