
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?
>|>|>
>|>|>
>|>|
>|>
>|>
>|