Hi.
From a "good code" standpoint, is it ok to just skip over errors if it provides for less if statements? Here's an example in pseudocode.
VB Code:
On Error Resume Next Dim Path as String Path = "" 'draw a circle picBox.DrawCircle 'if picture for better circle is present, load it, otherwise just skip 'If Path <> "" Then picBox.LoadPicture(Path) 'End if
As you can see, I can either skip right over the load error and I have my already drawn circle to back me up, or I can go through a slightly longer method of checking to see if an error will come up or not. In your opinion, is it ok to just skip the error like this?




Reply With Quote