I am trying to get my VBScript to report the proper value of a clicked button in a Message Box.
intAnswer = Msgbox("Enter Data", _
4, "Answer")
msgbox(intAnswer)
If intAnswer = 6 Then
Msgbox "You answered yes."
ElseIf intAnswer = 7 Then
Msgbox "You answered no."
ElseIf intAnswer = 2 Then
MsgBox "Cancelled."
End If
But, that first msgbox(intAnswer) always reports “False.” It’s never the VBScript constants I am expecting, so I never get any of the If Then Else statements.
I have tried vbYesNo instead of just 4. I thought they constant definitions might not be on the server, but it does not matter.
What am I doing wrong? How can I get my msgbox response to be a constant?
edit: this is a vbscript running on the command line a .vbs file (or double-click it from explorer).
edit: I have tried cint(intanswer) but I get the same result zero 0 in this case.
edit: further test reveals it only occurs on the server. the local machine works just fine.
I found extraneous code. It was a simple error. Removed it. All is well.