Constant: Refers to the amount of the value that remains constant while the program is running, and it is used to hold constants such as fixed values, strings, and so on.
Definition of constants: Use the Const directive in VBScript to create string or numeric constants whose names have a meaning, and to assign them a literal value.
Const " Ethon " Const in ' in general, constant names all use uppercase
using custom constants can also reduce effort, such as:MsgBox("Hello World") MsgBox("Hello World") MsgBox("Hello World") MsgBox("Hello World") MsgBox("Hello World"This program outputs five times Hello world, if you want to change the output to bye-Bye, you have to modify all the programs, of course you can manually modify 5 times, but if you want to output 1000 times? Constants can solve this problem for us:Consthw="Hello World" MsgBox(HW)MsgBox(HW)MsgBox(HW)MsgBox(HW)MsgBox(HW) so that when you want to modify the output, just modify the HW value on the line.
Note: Constants cannot be re-assigned
Const " This is a string " MsgBox " Modify content now "MsgBox MyString
Run the above script, error.
VBS BASICS-Constants