The VBScript Network and Systems Administrator's Cafe:

VBScript Statements


May 26, 2008  3:48 PM

VBScript Statements: Explanation of the Option Explicit Statement



Posted by: Jerry Lees
option, option explicit, VBScript, VBScript Statements, vbscriptstatements

In VBScript declaring your variables up front is not required (as stated in this sites explanation of the Dim Statement), however, many programmers choose to declare their variables up front to avoid having to track down misspellings in their code. They go further by adding the Option...

May 24, 2008  3:47 PM

VBScript Statements: Explanation of the Dim Statement



Posted by: Jerry Lees
DIM, DIM Statement, VBScript, VBScript Statements, vbscriptstatements

The DIM statement is used to declare variables prior to being used. To save space in your code, you can declare more than one variable in a single statement by separating each variable with a comma. For example: Dim x Dim x, y, z The Dim...


May 23, 2008  8:00 PM

VBScript Statements: Explanation of the Const Statement



Posted by: Jerry Lees
Const, Const statement, VBScript, VBScript Statements, vbscriptstatements

The Const statement is useful when you want to reference a specific, unchanging, value in your code multiple times without typing it over and over. For example, in order to use the Const Statement to create a reference to the value of pi to 50 decimal places, you use...


May 21, 2008  6:49 PM

VBScript Statements: Explanation of If… Then … Endif



Posted by: Jerry Lees
else, If Then, IF Then Else, Logical File, Then, VBScript, VBScript Statements, vbscriptstatements

The If/Then/Else statement in VBScript is very similar to the Select Case statement, except it only normally allows for 2 possibilities in your condition. ...


May 9, 2008  5:54 PM

VBScript Statements: Explanation of Select … Case



Posted by: Jerry Lees
Functions, VBScript, VBScript Statements, vbscriptstatements

The Select ... Case VBScript statement is a very powerful way to easily preform specific actions based on a comparison of a variable to a series of cases you specify, plus it allows for the fact that NONE of the cases apply with an optional case else...


April 13, 2008  1:40 AM

Converting variable types in vbscript from one type to another type



Posted by: Jerry Lees
Development, Functions, Variable Types, VBScript, VBScript Statements

In a previous posting, titled Variable types in...

Bookmark and Share     0 Comments     RSS Feed     Email a friend


March 12, 2008  5:38 PM

Use of option explicit and the DIM statement in VBSCRIPT.



Posted by: Jerry Lees
Development, Error control, Variable Types, VBScript, VBScript Statements

As an answer to the extra credit portion of my posting a few days ago: DIM in a script declares a variable to be used. It just simply creates the variable, nothing more. By default, vbscript will create variables on the fly for you as you use them...


March 3, 2008  9:11 PM

Using Set, GetObject, ExecQuery, and For Next in VBSCRIPT to use WMI objects



Posted by: Jerry Lees
Development, Networking, Objects, SQL, VBScript, VBScript Statements

In my last blog entry I explained error control via on error resume next and on error goto 0, there are other ways as well-- but for now this should work to get us by. Next well discuss the Set, GetObject, ExecQuery,...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: