The VBScript Network and Systems Administrator's Cafe

May 23 2008   8:00PM GMT

VBScript Statements: Explanation of the Const Statement



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

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 the following code:

Const pi = 3.14159265358979323846264338327950288419716939937510

The important thing to remember is that, constants can not be changed once set in your code– Doing so will result in an error being thrown.

Comment on this Post


You must be logged-in to post a comment. Log-in/Register