please dont rip this site
Microsoft® Visual Basic® Scripting Edition
VBScript Constants
Using VBScript |
Previous | Next |


What Is a Constant?
A constant is a meaningful name that takes the place of a number or string and never changes. VBScript currently has no constants defined by the language. In VBScript, constants are implemented as literal values assigned to variable names.

Creating Constants
You create constants in VBScript using the Const statement. Using the Const statement, you can create string or numeric constants with meaningful names. You can then assign them literal values and use them in your script. For example:

Const MyString
MyString = "This is my string."
Const MyAge
MyAge = 49
Note that the string literal is enclosed in quotation marks (" "). Quotation marks are the most obvious way to differentiate string values from numeric values. Date literals and time literals can be represented by enclosing them in number signs (#). For example:

Const CutoffDate
CutOffDate = #1-1-96#
Since there is no functional difference between constants created in this way and regular variables, you may want to adopt a naming scheme to differentiate constants from variables. This will prevent you from trying to reassign their values while your script is running. For example, you might want to use a "vb" prefix on your constant names, or you can name your constants in all capital letters as recommended in VBScript Coding Conventions. In either case, it is a good idea to differentiate constants from variables. This eliminates confusion as you develop more complex scripts.

© 1996 by Microsoft Corporation.

See also:

file: /Techref/language/asp/vbs/vbscript/2.htm, 2KB, , updated: 1996/11/22 11:12, local time: 2018/3/19 23:05,

 ©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE! / 

<A HREF=""> Constants - Microsoft&#174; Visual Basic&#174; Scripting Edition</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2018 contributors:
o List host: MIT, Site host, Top posters @20180319 RussellMc, Isaac M. Bavaresco, Sean Breheny, Van Horn, David, Neil, David C Brown, alan.b.pearce, Bob Blick, John Gardner, Brent Brown,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!