GAPVelocity.ai
This feature allows the VB6 AI Migrator to recognize most of the “On Error” patterns and replace the unmanaged error handling by Try ... Catch statements. Some very complex spaghetti-code patterns wouldn’t be recognized by VB6 AI Migrator, but it already recognizes a large amount of cases with different combinations of statement (On Error Goto, Labels, Goto, Resume, Exit Sub/Function, Break, etc.)
Some straightforward examples are shown below.
On Error Goto errLabel <CodeBlock1> <Exit Sub/Function> errlabel: <CodeBlock2>
try { <CodeBlock1> <Return> } catch { <CodeBlock2> }
On Error Goto errLabel <CodeBlock1> <Exit Sub/Function> errlabel: <CodeBlock2>
try{ <CodeBlock1> <Return> }catch{ <CodeBlock2> }
On Error Goto errLabel <CodeBlock1> resumeLabel: <CodeBlock2> <Exit Sub/Function> errlabel: <CodeBlock3> Resume resumeLabel
try{ <CodeBlock1> <Return> }catch{ <CodeBlock3> } finally { <CodeBlock2> }