...
Code Block |
---|
VBASIC.XML <subcode id="Len"> <loc status="extension" narg="1" code="%1d.Len()"/> <---- here is where .Len is specified <vbn narg="1" code="Strings.Len(%1d)"/> <jvs narg="1" code="len(%1d)"/> <csh narg="1" code="VBNET.Strings.Len(%1d)"/> </subcode> |
In a "Lightweight Object Oriented" translation, str.Len is an extension method in MigrationSupport. The Len extension method can be satisfied by a stub authored by the tool or by the implementation distributed in MigrationSupport.dll. The reason loc uses str.Len instead of string.Length is that str.Length will throw an exception if str is null, but str.Len will return 0. This null handling is more consistent with the VB6 Len function and it is better fit for general use in VB.NET.
If you want to handle nulls on your own, and use String.Length in the VB.NET, you use the standard coding style or create a custom coding style for your project.
The "Lightweight Object Oriented" coding style is activated by the following statement in the translation script:
<ScriptRule id="LightWeightBias" />
Removing the above statement from the script will result in translations using the standard code forms. The standard forms are the ones in the csh/vbn/all tags in the configuration files.
If you wish to create a custom coding style, please read the attached article and contact us for assistance:
https://portalgreatmigrations.greatmigrationsatlassian.comnet/wiki/display/GMG/Custom+VB6+Language+Replacementhttps://portalgreatmigrations.greatmigrationsatlassian.comnet/wiki/display/GMG/Custom+VB6+Language+Replacement
Notes:
1) A recent enhancement to the "Lightweight Object Oriented" coding style is to upgrade VB6.Collection and Scripting.Dictionary to strongly typed generic collections.
2) <ScriptRule id="LightWeightBias" /> rules is deprecated. You may simply use the <Select SubSystem="loc" directly now.)
Please let me know if this answers your question.