VB Script error

Self build / N/A
August 2, 2009 at 19:27:18
Specs: WinXP, 1.5Ghz, 256MB
Can someone help with this script:
<%
' Grab current time from Now() function.
Dim timeValue
timeValue = Now() %>
The time, in 24-hour format, is <%=Hour(timeValue)%>:<%=Minute(timeValue)%>:<%=Second(timeValue)%>.
I copied this from Wikipedia's article on VB Script. Made some mods and saved as .vbs file. When i try to execute I get the following error:
Compilation Error
Line 1
Char 2
Expected Statement
Code: 800A0400

See More: VB Script error

Report •


#1
August 5, 2009 at 06:58:23
No, you copied Wikipedia's ASP VBScript example. Wikipedia doesn't have a vanilla VBScript example.

The version you want looks like this:

' Grab current time from Now() function.
Dim timeValue
timeValue = Now() 
WScript.Echo "The time, in 24-hour format, is " & Hour(timeValue) & ":" & Minute(timeValue) & ":" & Second(timeValue) &"."


Report •
Related Solutions


Ask Question