09-08-2020 05:54 AM
Hi,
I was planning on using a message box with the message type 'error' and an OK button to tell the user that something is wrong and to halt the script. The help files state that the script is halted if the message type is 'error'. This is exactly what I want, however, it doesn't behave as expected. It first shows my message box with the correct text and an OK button (whether you set the button to OK or not) but after pressing OK it then shows the standard error message box with the same text.
What's the point of doubling up like that? It seems to force me to avoid using the message type 'error' and instead to use a different type, like 'note', and halt the script manually.
The code is:
L2 = 0
L3 = 0
If L2 = 0 Or L3 = 0 Then
Call MsgBoxSetPos(30, 40, 20, 10)
Call MsgBoxDisp("The file is too short to process.", , "MsgTypeError")
End If
Anyone know how to avoid throwing the second error message?
Regards, Simon.
Solved! Go to Solution.
09-08-2020 03:17 PM
Hi Simon,
just tried this, funny behaviour of Diadem.
If you just use
Call Err.Raise(8,, "The file is too short to process.")
instead of MsgBoxDisp, then it seems to work, even the position is taken over.
Regards, Steve
09-09-2020 04:08 AM
Thanks Steve.
I couldn't find reference to error number 8; what does it mean?
Regards.
09-09-2020 05:35 AM
Hi Simon,
that error number is not predefined as far as I have seen, so it hasn't a meaning.
But you can take any number that is unused (if you google "vbscript error codes", you see the standard values).
As the Diadem dialog does not evaluate the number you can probably use any number.
Steve