You are currently viewing the BOOK: VBScript Programmer's Reference, 1st, 2nd, and 3rd editions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
The below script will not display the err in a windows dialog.
It is displayed in the command box and is only seen if I execute it from the command prompt.††
If I click on the file name in windows explorer the command prompt box appears and disappears so quick that the result is lost.
Dim x, y
x = InputBox("Please enter a number to divide into 100.")
If x <> 0 Then
y = 100 / x
MsgBox "100 divided by " & x & " is " & y & "."
Err.Raise vbObjectError + 15000, _
"Hey, stupid, you can't enter a zero. It will " & _
"cause a divide by zero error."
Why doesn't the windows dialog box appear as shown in the book?