... to allow the programmer to employ poor coding habits.
In most cases that is indeed the reason ...
However ... it can actually be a very handy tool if used properly ...
Consider a loop that does series of tasks (or even a single task) on a group of objects. We are all familiar with the "For Next" loops ...or at least most of us are ...
It is my understanding (and I am frequently wrong) that this error handler allows you to skip over the items causing this error within the loop ...
example
CharCode = 32
On Error Resume Next
For X = -127 to 127
MsgBox CharCode / X
Next X
Now while the point of this exercise might be pointless, it will catch the divide by zero error that will be generated when X = 0, thus the loop will continue to execute until it is finished.
Now for an example of how it can be used for the lazy programmer ...
Set ThisSSet = ThisDrawing.SelectionSets.Add("NewSSet")
ThisSSet.SelectOnScreen
On Error Resume Next
For Each ACBlock in ThisSSet
MsgBox ACBlock.Name & vbCr & _
"X:" & ACBlock.XScaleFactor & vbCr & _
"Y:" & ACBlock.YScaleFactor & vbCr & _
"Z:" & ACBlock.ZScaleFactor
Next ACBlock
Now what happens is if there is an object that is not a block it will generate an error because of the properties being read and the error handler will do it's job. This is an example of lazy programming as the user could have programmed in a filter to allow for only the selection of blocks. Plus what happens when the function encounters a block that has had the name stripped from the drawing database as in some of the older CadLock drawings.
BUT
If you call another subroutine without an error handler AFTER you use the Resume Next handler, if the called function has an error it will be a pain in the butt to find it because the function will work as though nothing is wrong ... been there done that ... learned the hard way
