I don't know why this code doesn't work:
Dim a
a = InputBox("What time do you want?")
If InStr(a, "pm") Then
(Replace(a, "pm", ""))
a = a + 12
c = MsgBox(a, 0, Time)
WScript.Quit
Else
End If
b = MsgBox(a & form, 0, "L")
Whenever I try to start it, it responds with:
"Error: Expected Statement"
Is it because the Replace
statement isn't right or because there's a mistake in the rest of the script?
When you try to run that code you should get the following error
which will lead you to the culprit which is
which isn't a valid statement in VBScript hence the error.
Based on what you are trying to do the script needs to return the result of the
Replace()
function call, something like this