The VBScript Network and Systems Administrator's Cafe

Jun 20 2008   3:19PM GMT

VBScript Statements: Explanation of the Erase statement

Jerry Lees Jerry Lees Profile: Jerry Lees

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 following would print a blank line:

Redim Bob(10)
Bob(1) = “Rickky Bobby”
Erase Bob
Wscript.echo Bob(1)

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

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:

Share this item with your network: