- INDEX VB TO NET
- VBUC FEATURES
- ADVANCED CODE REFACTORING
- LANGUAGE IMPROVEMENTS
Detailed Code Improvements
As part of the VBUC’s advanced functionalities, the tool makes the converted code more .NET-like, while also improving aesthetic aspects.
Some of the enhancements are related to code simplifications. The following examples show some of these cases:
Source pattern | Target .NET pattern |
if <cond> then return true else return false | return <cond> |
if <cond> then <var> = true else <var> = false | <var> = <cond> |
if <cond> then <var> = false else <var> = true | <var> = !<cond> |
<booleanexpression> compared to true or false | [!] <booleanexpression> |
Operations simplifications like: (<exp> + 1) > 0 |
<exp> >= 0 |
!(!<expression>) | <expression> |
Arithmetic simplifications | Several simplifications like: (<expression> + 1) - 1 => <expression> |
Err.Raise | throw new Exception() |