DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Message box display - error type

Solved!
Go to solution

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.

0 Kudos
Message 1 of 4
(2,525 Views)
Solution
Accepted by topic author Simon_Aldworth

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

0 Kudos
Message 2 of 4
(2,500 Views)

Thanks Steve.

 

I couldn't find reference to error number 8; what does it mean?

 

Regards.

0 Kudos
Message 3 of 4
(2,480 Views)

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

0 Kudos
Message 4 of 4
(2,471 Views)