Err.Raise Number starting point 
Author Message
 Err.Raise Number starting point

I'm trying to figure out what is the best point to start defining user-defined
error numbers for use with Err.Raise.  Should it be 32000 on up.  65535 on up?


Fri, 04 May 2001 03:00:00 GMT  
 Err.Raise Number starting point
There is a constant for exactly this purpose: vbObjectError
Theortetically, you should be able to use any number from
vbObjectError+1 to vbObjectError+64K, but, to be safe, leave a little
buffer and start with at least vbObjectError+512 and just pick a
random group in that range.

 -- Andy

Quote:

>I'm trying to figure out what is the best point to start defining user-defined
>error numbers for use with Err.Raise.  Should it be 32000 on up.  65535 on up?



Sat, 05 May 2001 03:00:00 GMT  
 Err.Raise Number starting point
A debug.print of VbObjectError shows a value of -2147221504.  Why such a huge
negative number?  I've read that (theoretically), I can use any positive value
over 32K or 64K.

|There is a constant for exactly this purpose: vbObjectError
|Theortetically, you should be able to use any number from
|vbObjectError+1 to vbObjectError+64K, but, to be safe, leave a little
|buffer and start with at least vbObjectError+512 and just pick a
|random group in that range.
|
| -- Andy
|
|
|>I'm trying to figure out what is the best point to start defining user-defined
|>error numbers for use with Err.Raise.  Should it be 32000 on up.  65535 on up?
|>
|>
|



Sat, 05 May 2001 03:00:00 GMT  
 Err.Raise Number starting point
Mine is not to reason why. This is what Microsoft recommends using,
and is the reason that constant is provided.

 -- Andy

Quote:

>A debug.print of VbObjectError shows a value of -2147221504.  Why such a huge
>negative number?  I've read that (theoretically), I can use any positive value
>over 32K or 64K.


>|There is a constant for exactly this purpose: vbObjectError
>|Theortetically, you should be able to use any number from
>|vbObjectError+1 to vbObjectError+64K, but, to be safe, leave a little
>|buffer and start with at least vbObjectError+512 and just pick a
>|random group in that range.
>|
>| -- Andy
>|

>|
>|>I'm trying to figure out what is the best point to start defining user-defined
>|>error numbers for use with Err.Raise.  Should it be 32000 on up.  65535 on up?
>|>
>|>
>|



Sat, 05 May 2001 03:00:00 GMT  
 Err.Raise Number starting point
Not a very good recommendation, if you ask me.  Having a message box come up
with such an ugly negative number (or logging same to a file on disk) is not my
idea of an easy to read message.  In the Access 97 Developer's Handbook, the
authors mention the use of values greater than 32K or 64K, which seems more
reasonable to me.  I was just trying to see if anyone follows that advice or the
one from Microsoft that you mention.

I personally prefer positive values for error message numbering.  It sure would
be nice if Microsoft would formally document a range of positive values that are
"reserved" for application programmers instead of having to use ugly, negative
values.

|Mine is not to reason why. This is what Microsoft recommends using,
|and is the reason that constant is provided.
|
| -- Andy
|
|
|>A debug.print of VbObjectError shows a value of -2147221504.  Why such a huge
|>negative number?  I've read that (theoretically), I can use any positive value
|>over 32K or 64K.
|>
|>|There is a constant for exactly this purpose: vbObjectError
|>|Theortetically, you should be able to use any number from
|>|vbObjectError+1 to vbObjectError+64K, but, to be safe, leave a little
|>|buffer and start with at least vbObjectError+512 and just pick a
|>|random group in that range.
|>|
|>| -- Andy
|>|
|>|
|>|>I'm trying to figure out what is the best point to start defining
user-defined
|>|>error numbers for use with Err.Raise.  Should it be 32000 on up.  65535 on
up?
|>|>
|>|>
|>|
|>
|>
|



Sat, 05 May 2001 03:00:00 GMT  
 Err.Raise Number starting point
I'm not sure I understand what makes a number logged to a file be
ugly, but if you want, you can always subtract vbObjectError before
logging the number. However, you do risk confilicts. No positive
numbers are reserved. Use high positive numbers if you prefer, but I
can tell you that the ADH authors now use vbObjectError if they need
to raise custom errors. Sorry you don't like this recommendation.

 -- Andy

Quote:

>Not a very good recommendation, if you ask me.  Having a message box come up
>with such an ugly negative number (or logging same to a file on disk) is not my
>idea of an easy to read message.  In the Access 97 Developer's Handbook, the
>authors mention the use of values greater than 32K or 64K, which seems more
>reasonable to me.  I was just trying to see if anyone follows that advice or the
>one from Microsoft that you mention.

>I personally prefer positive values for error message numbering.  It sure would
>be nice if Microsoft would formally document a range of positive values that are
>"reserved" for application programmers instead of having to use ugly, negative
>values.


>|Mine is not to reason why. This is what Microsoft recommends using,
>|and is the reason that constant is provided.
>|
>| -- Andy
>|

>|
>|>A debug.print of VbObjectError shows a value of -2147221504.  Why such a huge
>|>negative number?  I've read that (theoretically), I can use any positive value
>|>over 32K or 64K.
>|>

>|>|There is a constant for exactly this purpose: vbObjectError
>|>|Theortetically, you should be able to use any number from
>|>|vbObjectError+1 to vbObjectError+64K, but, to be safe, leave a little
>|>|buffer and start with at least vbObjectError+512 and just pick a
>|>|random group in that range.
>|>|
>|>| -- Andy
>|>|

>|>|
>|>|>I'm trying to figure out what is the best point to start defining
>user-defined
>|>|>error numbers for use with Err.Raise.  Should it be 32000 on up.  65535 on
>up?
>|>|>
>|>|>
>|>|
>|>
>|>
>|



Tue, 08 May 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Err.Raise in OLE Server EXE not raising error in calling program

2. Err.Raise - error not being re-raised all the way to top of the call stack

3. Converting floating point number to IEEE 32-bit precision floating point format

4. Err.Raise Causes Automation Error

5. Raising Err in Class Module

6. err.raise not trappable in class module

7. Err.Raise causes Error

8. Question! Err.raise

9. Problems when using Err.Raise in a public method of an activex

10. Err.Raise : Automation Error

11. Getting mad with Casading Err.raise

12. Err.Raise() compiled vs ide ?

 

 
Powered by phpBB® Forum Software