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?
a = Replace(a, "pm","")which is the cause of the error.Replace()has to return something,(Replace(a, "pm",""))is not a valid statement without a return value.Replace()or show any code, how was I supposed to know? Plus Stack Overflow is about creating a canonical library of questions and answers not answering the same question in various ways over and over. Hopefully, the answer here will help understand how to use theReplace()function. Also, why leave you're comment here when you could have left it on the question you're referring to?