Initialize the variable in Third Line

Dim DateToday
'Initialize the variable
DateToday = Date
MsgBox "Today's date is " &DateToday & "."


What we are doing in line three is that we are initializing the variable DateToday. To do this, we are using a built-in VBScript function called Date. A function is a piece of code that returns a value. VBScript comes with a lot of built-in functions. These functions are part of the language, and they're always available for your use. The Date function returns the current date according to the computer's internal clock. In line three we are telling the script engine, "Take the value returned by the Date function, and store it in the variable called DateToday." Notice that we did not name the variable Date, but rather DateToday. This is necessary because, since date is a built-in VBScript function, "date" is a reserved word. You cannot name your variable with the same name as a reserved word.

First
Next