The VBScript Network and Systems Administrator's Cafe:

vbscriptstatements


May 4, 2009  5:10 PM

VBScript Statements: Explanation of the Execute Statement



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

The VBScript Execute statement allows you to execute a series of VBScript statements as a block from within a VBScript Script. By itself it doesn't sound terribly appealing... after all, Executing a series of VBScript statements is what you do inside a VBScript file. However, if you consider...

July 3, 2008  2:55 AM

VBScript Statements: Explanation of the Rem Statement



Posted by: Jerry Lees
Developer documentation, REM, VBScript, VBScript Statements, vbscriptstatements

The VBScript REM statement is used to place a comment in your script or function. It is typically considered essential to place comments in code, not only to document what something does for others-- but for yourself 6 months down the line.  Another short hand method of placing a comment in the...


July 2, 2008  12:06 AM

VBScript Statements: Explanation of the For Each … Next Statement



Posted by: Jerry Lees
Conditional statements, for, for each, for each next, next, VBScript Statements, vbscriptstatements, working with arrays

The For Each Next statement combination is very useful for situations where you need to loop through a piece of code a specific number of times, just like the For Next statement, except that you may not even know at run time how many...


June 28, 2008  11:20 PM

VBScript Statements: Explanation of the For … Next Statement



Posted by: Jerry Lees
Conditional statements, for, for next, next, step, VBScript, VBScript Statements, vbscriptstatements

The For Next statement is very useful for situations where you need to loop through a piece of code a specific number of times.    You can use Exit For statements to exit out of a For loop, if you need to check for a...


June 20, 2008  3:19 PM

VBScript Statements: Explanation of the Erase statement



Posted by: Jerry Lees
dimensional arrays, erase, VBScript, VBScript Statements, vbscriptstatements, working with arrays

The VBScript Erase statement is used to erase all the values of an array, but keep the array size and dimensions intact.  This is useful when you re-use an array and you want to ensure the values inside an array have truely been cleared and no old data is left in the array. For example, the...


June 18, 2008  1:14 PM

VBScript Statements: Explanation of the Exit statement



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

The Exit statement in vbscript allows you to exit a block of code, in the case of a subroutine (Exit Sub) or a function (Exit Function), or the entire script.

This statement is assumed at the end of a script, and therefore is not required, but is typically used in conditional statements...


June 14, 2008  10:19 PM

VBScript Statements: Explanation of the Do Loop Statement



Posted by: Jerry Lees
Conditional statements, do loop, do until, do while, until, VBScript, VBScript Statements, vbscriptstatements, while

The Do ... Loop statement is very useful (like, for ... next and Select ... case) to execute a block of code more than once. However, where it differs from the other two is that the Do ... Loop statement executes the code as long as (while) a condition is true or...


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...


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: