VbScript

Using VBScript with Objects

Using VBScript with Objects Using Objects Whether you use an ActiveX™ control (formerly called an OLE control) or a Java™ object, Microsoft Visual Basic Scripting Edition and Microsoft® Internet Explorer handle it the same way. If you’re using Internet Explorer and have installed the controls available in the ActiveX Gallery, ...

Read More »

VBScript and Forms

VBScript and Forms Simple Validation You can use Visual Basic Scripting Edition to do much of the form processing that you’d usually have to do on a server. You can also do things that just can’t be done on the server. Here’s an example of simple client-side validation. The HTML ...

Read More »

A Simple VBScript Page

A Simple VBScript Page With Microsoft® Internet Explorer, you can view the page produced by the following HTML code. If you click the button on the page, you see VBScript in action. <HTML> <HEAD><TITLE>A Simple First Page</TITLE> <SCRIPT LANGUAGE="VBScript"> <!-- Sub Button1_OnClick MsgBox "Mirabile visu." End Sub --> </SCRIPT> </HEAD> ...

Read More »

VBScript Coding Conventions

VBScript Coding Conventions What Are Coding Conventions? Coding conventions are suggestions that may help you write code using Microsoft Visual Basic Scripting Edition. Coding conventions can include the following: Naming conventions for objects, variables, and procedures Commenting conventions Text formatting and indenting guidelines The main reason for using a consistent ...

Read More »

VBScript Procedures

VBScript Procedures Kinds of Procedures In VBScript there are two kinds of procedures; the Sub procedure and the Function procedure. Sub Procedures A Sub procedure is a series of VBScript statements, enclosed by Sub and End Sub statements, that perform actions but don’t return a value. A Sub procedure can ...

Read More »

Looping Through Code

Looping Through Code Using Loops to Repeat Code Looping allows you to run a group of statements repeatedly. Some loops repeat statements until a condition is False; others repeat statements until a condition is True. There are also loops that repeat statements a specific number of times. The following looping ...

Read More »

Using Conditional Statements

Using Conditional Statements Controlling Program Execution You can control the flow of your script with conditional statements and looping statements. Using conditional statement, you can write VBScript code that makes decisions and repeats actions. The following conditional statements are available in VBScript: If…Then…Else statement Select Case statement Making Decisions Using ...

Read More »

VBScript Operators

VBScript Operators VBScript has a full range of operators, including arithmetic operators, comparison operators, concatenation operators, and logical operators. Operator Precedence When several operations occur in an expression, each part is evaluated and resolved in a predetermined order called operator precedence. You can use parentheses to override the order of ...

Read More »

VBScript Constants

VBScript Constants What Is a Constant? A constant is a meaningful name that takes the place of a number or string and never changes. VBScript defines a number of intrinsic constants. You can get information about these intrinsic constants from the VBScript Language Reference. Creating Constants You create user-defined constants ...

Read More »

VBScript Variables

VBScript Variables What Is a Variable? A variable is a convenient placeholder that refers to a computer memory location where you can store program information that may change during the time your script is running. For example, you might create a variable called ClickCount to store the number of times ...

Read More »