Skip to content

Blog

01/08/2014 public release

gmStudio<br />[Fix] Improve reporting only mode (i.e. expired/violated license) to work properly<br />[Fix] Hide Rules Panel unless license level is "Special<br /> Rules Panel will be delivered in a future release.<br />[Chg] Correct project folder auto repair to support new folder naming conventions

01/06/2014 public release

gmBasic V20.01B4<br />[Fix] Correct problem with ASP Malformation: JS switch-case : VBS comment with if statement in case<br />[Fix] Correct Alpla Error relating to statement separator ':'<br />[Fix] Corrected optional currency arguments<br />[Add] Add <Select NamedArgs="on"> to allow Named Actual Arguments and Optional Arguments in C#<br />[Add] Implicit ByRef with Calls to Interop Assemblies<br />[Add] Better support for using ComboBox.ItemData and ListBox.ItemData in Code<br />[Add] Support for MigPatterns for the Initialization block in migrated ActiveX controls<br />[Add] Trace Logging (see rules\instrument.xml)<br />[Add] Additional gmSL command to improve source parsing and file handling capabilities
MetaLang <br />[Chg] idf\MigrationSupport.dll.xml<br />[Chg] lang\enumerations.xml<br />[Chg] lang\GMSLANG.XML<br />[Chg] lang\messages.xml<br />[Chg] lang\netControls.xml<br />[Chg] lang\oocSubSystem.gmsl<br />[Chg] lang\OPCODES.XML<br />[Chg] lang\templates.xml<br />[Chg] lang\TYPES.XML<br />[Chg] lang\VB6IDL.XML<br />[Chg] lang\VBASIC.XML<br />[Chg] lang\vbcontrols.xml<br />[Chg] lang\vbmethods.xml
gmStudio<br />[Add] Batch Task Presets
MigrationSupport.dll<br />[Chg] Improved DataLib (ADODB Emulation)<br />[Add] VB6 FileSystem Emulation<br />[Add] Error Handling support<br />[Add] Extension methods for Object-Oriented C# standard
Sample Rules and Settings Templates<br />[Add] Trace Logging Instrumentation; see instrument.xml and gmsl<br />[Chg] GM.EXCEL_Interop.EXE.xml<br />[Chg] GM.MSComCt2_WinForms.OCX.XML<br />[Chg] GM.msmask32.ocx.xml<br />[Chg] GM.MSWORD_Interop.OLB.xml<br />[Chg] GM.richtx32.ocx.xml<br />[Chg] GM.shdocvw.dll.xml
Standard Samples<br />[Fix] Repackaged samples to be consistent with new conventions

11/25/2013 public release

gmBasic V20.01B1<br />[Add] Additional support for adding migration patterns to accessors in rules files<br />[Add] Add Refactor/Remove status=conditional<br />[Add] Add migration of ListBox.List and ComboBox.List from Property bag to WinForms Designer Files<br />[Add] add migration of ListBox.List and ComboBox.List from Property bag to WPF XAML Files<br />[Add] Add migrate library@uuid for use with Select ProjectRefernces<br />[Fix] Fix C# default when select UseOverloads=on<br />[Fix] Fix problem with processing Server-Side script tags begining with a comment
MetaLang<br />[Chg] lang\authortext.xml (added handlers for Refactor/Remove status=conditional)<br />[Chg] lang\enumerations.xml (added subsystem=ooc)<br />[Chg] lang\GMSLANG.XML<br />[Chg] lang\netControls.xml <br />[Chg] lang\OPCODES.XML (gmSL updates)<br />[Chg] lang\SharedFile.gmsl (correction)<br />[Chg] lang\VB6IDL.XML (ooc, loc, and wpf changes)<br />[Chg] lang\VBASIC.XML (ooc, loc, and wpf changes) <br />[Chg] lang\wpfSubsystem.gmsl (wpf updates)<br />[Chg] idf\MigrationSupport.dll.xml (correct casing on function names)
gmStudio<br />[Add] Added [View\Source Root] option to main menu. Opens folder specified by VirtualRoot entry in the project file.<br />[Add] Add ImageList size constraints in ResxFactory to prevent exception when either dimension exceeds 256 pixels<br />[Chg] Modify default settings for VBI Audit to report pre-analyzer information<br />[Chg] Improve "argument#: cannot convert " errors in NET Build Log report<br />[Chg] Change help documentation paths to avoid redirect warnings. <br />[Chg] Update index.html to help documentation paths to avoid redirect warnings<br />[Chg] Improved file matching algorithm on settings form (added *.OLB.XML)<br />[Add] Implemented changes to support licensing for MSDN promotion<br />[Chg] Modified license line count check to ignore blank lines<br />[Fix] Fix problem with displaying About gmStudio report<br />[Add] Add gmBasic version to Help About Report
Sample Rules and Settings Templates<br />[Chg] Improvements to TabDlg migration<br />[Chg] Improvements to MSMask Migration<br />[Chg] Improvements to MSComCtlLib Migration (TabStrip)<br />[Chg] Update mig.vb7lang.xml to include new subsystems<br />[Cht] Add GlobalStubs.xml template script added to settings folder<br />[Add] ADODB_DataLib_Transform.gmsl<br />[Add] GM.ADODB_to_DataLib.dll.xml<br />[Add] GM.EXCEL_Interop.EXE.xml<br />[Add] GM.ieframe.dll.xml<br />[Add] GM.MSComCt2_WinForms.OCX.XML<br />[Chg] GM.MSCOMCTL.OCX.xml<br />[Add] GM.MSHFLXGD.OCX.xml<br />[Chg] GM.msmask32.ocx.xml<br />[Add] GM.MSWORD_Interop.OLB.xml<br />[Chg] GM.msxml6.dll.xml<br />[Add] GM.richtx32.ocx.xml<br />[Add] MscomctlMigration.dll<br />[Add] ScrrunMigration.dll

10/13/2013 public release

gmBasic 10.07B3
[+] Additional gmSL and metalang improvements to support subsystems
[+] Continue work on WPf subsystem: VB6 forms to WPF (added numerous properties, nested containers, and TabControl support)
[+] Begin work on OOC subsystem: Object-Oriented C# (OOC) coding standard (removes Microsoft.VisualBasic (aka VBNET) namespace)
[+] Add ComputeConditional=Clean to remove pre-compiler logic and inactive VB6-code
[+] Increase gmSL stack to allow for larger code generation requirements
[+] Add metalang support for different metalang files.
[+] Add support for ListBox.List property in FRX to Designer
[+] Add six custom opcodes (SLA-SLF) for suybsystems to use as desired. Allows introducing original semantics as desired.
[!] Correction for TypeOf issue to improve intentionally weakly-typed code
MetaLang
[Add] idf\LanguageTransform.gmsl (needed with Language.Std.xml for WPF)
[Add] lang\oocSubSystem.gmsl
[Change] idf\MigrationSupport.dll.xml: support for filesystem and other VB6 compatibility improvements (activated with subsystem=ooc)
[Change] idf\Language.std.xml
[Change] lang\authorText.xml: adding support for VS2012 projects
[Change] lang\enumerations.xml
[Change] lang\GMSLANG.XML
[Change] lang\OPCODES.XML
[Change] lang\templates.xml (allows using subsystem patterns now)
[Change] lang\VB7Lang.xml (ooc/wpf support)
[Change] lang\VB6IDL.XML (ooc/wpf support)
[Change] lang\VBASIC.XML (ooc/wpf support)
[Change] lang\vbcontrols.XML (ooc/wpf support)
[Change] lang\wpfSubsystem.gmsl
gmStudio
[+] Modify Settings form to facilitate comparing default gmStudio.cfg to user's copy
[+] Add support for reporting XAML Compiler issues in .NET Build Log report
[!] Correct Rebuild Interop assembly feature from reference list context menu
Sample Rules and Settings Templates
[+] Update SSTab rules (GM.TABCTL32.OCX.xml, TabctlTransform.gmsl)
[+] Update ComDlg Rules (GM.COMDLG32.OCX.gmSl, GM.COMDLG32.OCX.xml, GM.COMDLG32_Remove.OCX.xml)
[+] Add migration DLLs for Scripting, and MSComCtlLib to sample rules folder
[+] Update mig.vb7lang.xml to include new subsystems
[+] Add GlobalStubs.xml template script to settings folder

C# Migration Highlights

Software migration is a complex process. During a transformation one must consider multiple aspects of the output code (Equivalence, Complexity, Readability, Maintainability, etc.) In this blog, I wanted to highlight some of our VB6 to C# (.NET) transformations.

BeforeAfter
If Dir(LogPath, vbDirectory) <> "" Then
if (System.IO.Directory.Exists(LogPath))
If Dir(FName) <> "" Then
if (System.IO.File.Exists(FName))
BeforeAfter
i = DateDiff("YYYY", d2, d)
i = DateDiff("M", d2, d)
i = DateDiff("D", d2, d)
i = DateDiff("H", d2, d)
i = DateDiff("N", d2, d)
i = DateDiff("S", d2, d)
i = (d.Year - d2.Year);
i = ((d.Month + (d.Year * 12)) - (d2.Month + (d2.Year * 12)));
i = ((int)d.Date.Subtract(d2.Date).TotalDays);
i = ((int)d.Subtract(d2).TotalHours);
i = ((int)d.Subtract(d2).TotalMinutes);
i = ((int)d.Subtract(d2).TotalSeconds);
BeforeAfter
'MsgBox with message and title only
i = MsgBox("a message box test", , "title")
If MsgBox("a message box test", , "title") Then
End If
// MsgBox with message and title only
i = MessageBox.Show("a message box test","title",MessageBoxButtons.OK);
if (MessageBox.Show("a message box test","title",MessageBoxButtons.OK) == DialogResult.Yes)
{
}
i = MsgBox("Save File Before Closing ?", 51)
i = MessageBox.Show("Save File Before Closing ?","",MessageBoxButtons.YesNoCancel,MessageBoxIcon.Exclamation);
Call MsgBox("a message box test", vbCritical Or _
vbYesNoCancel Or _
vbAbortRetryIgnore Or _
vbApplicationModal Or _
vbDefaultButton2 Or _
vbQuestion, "title")
MessageBox.Show("a message box test","title",MessageBoxButtons.YesNoCancel |
MessageBoxButtons.AbortRetryIgnore,
MessageBoxIcon.Error |
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2,
MessageBoxOptions.ServiceNotification);
BeforeAfter
'Tests copied from http://msdn.microsoft.com/en-us/library/swf8kaxw.aspx
' The following statement returns True (does "F" satisfy "F"?)
wBA "Like", "'F' Like 'F'", "F" Like "F"
'
' The following statement returns False for Option Compare Binary
' and True for Option Compare Text (does "F" satisfy "f"?)
wBA "Like", "'F' Like 'f'", "F" Like "f"
'
' The following statement returns False (does "F" satisfy "FFF"?)
wBA "Like", "'F' Like 'FFF'", "F" Like "FFF"
'
' The following statement returns True (does "aBBBa" have an "a" at the
' beginning, an "a" at the end, and any number of characters in
' between?)
wBA "Like", "'aBBBa' Like 'a*a'", "aBBBa" Like "a*a"
'
' The following statement returns True (does "F" occur in the set of
' characters from "A" through "Z"?)
wBA "Like", "'F' Like '[A-Z]'", "F" Like "[A-Z]"
'
' The following statement returns False (does "F" NOT occur in the
' set of characters from "A" through "Z"?)
wBA "Like", "'F' Like '[!A-Z]'", "F" Like "[!A-Z]"
'
' The following statement returns True (does "a2a" begin and end with
' an "a" and have any single-digit number in between?)
wBA "Like", "'a2a' Like 'a#a'", "a2a" Like "a#a"
'
' The following statement returns True (does "aM5b" begin with an "a",
' followed by any character from the set "L" through "P", followed
' by any single-digit number, and end with any character NOT in
' the character set "c" through "e"?)
wBA "Like", "'aM5b' Like 'a[L-P]#[!c-e]'", "aM5b" Like "a[L-P]#[!c-e]"
'
' The following statement returns True (does "BAT123khg" begin with a
' "B", followed by any single character, followed by a "T", and end
' with zero or more characters of any type?)
wBA "Like", "'BAT123khg' Like 'B?T*'", "BAT123khg" Like "B?T*"
'
' The following statement returns False (does "CAT123khg"?) begin with
' a "B", followed by any single character, followed by a "T", and
' end with zero or more characters of any type?)
wBA "Like", "'CAT123khg' Like 'B?T*'", "CAT123khg" Like "B?T*"
// Tests copied from http://msdn.microsoft.com/en-us/library/swf8kaxw.aspx
//
// The following statement returns True (does "F" satisfy "F"?)
wBA("Like","'F' Like 'F'",Regex.IsMatch("F","F").ToString());
//
// The following statement returns False for Option Compare Binary
// and True for Option Compare Text (does "F" satisfy "f"?)
wBA("Like","'F' Like 'f'",Regex.IsMatch("F","f").ToString());
//
// The following statement returns False (does "F" satisfy "FFF"?)
wBA("Like","'F' Like 'FFF'",Regex.IsMatch("F","FFF").ToString());
//
// The following statement returns True (does "aBBBa" have an "a" at the
// beginning, an "a" at the end, and any number of characters in
// between?)
wBA("Like","'aBBBa' Like 'a*a'",Regex.IsMatch("aBBBa","a.*a").ToString());
//
// The following statement returns True (does "F" occur in the set of
// characters from "A" through "Z"?)
wBA("Like","'F' Like '[A-Z]'",Regex.IsMatch("F","[A-Z]").ToString());
//
// The following statement returns False (does "F" NOT occur in the
// set of characters from "A" through "Z"?)
wBA("Like","'F' Like '[!A-Z]'",Regex.IsMatch("F","[^A-Z]").ToString());
//
// The following statement returns True (does "a2a" begin and end with
// an "a" and have any single-digit number in between?)
wBA("Like","'a2a' Like 'a#a'",Regex.IsMatch("a2a","a\\da").ToString());
//
// The following statement returns True (does "aM5b" begin with an "a",
// followed by any character from the set "L" through "P", followed
// by any single-digit number, and end with any character NOT in
// the character set "c" through "e"?)
wBA("Like","'aM5b' Like 'a[L-P]#[!c-e]'",Regex.IsMatch("aM5b","a[L-P]\\d[^c-e]").ToString());
//
// The following statement returns True (does "BAT123khg" begin with a
// "B", followed by any single character, followed by a "T", and end
// with zero or more characters of any type?)
wBA("Like","'BAT123khg' Like 'B?T*'",Regex.IsMatch("BAT123khg","B.?T.*").ToString());
//
// The following statement returns False (does "CAT123khg"?) begin with
// a "B", followed by any single character, followed by a "T", and
// end with zero or more characters of any type?)
wBA("Like","'CAT123khg' Like 'B?T*'",Regex.IsMatch("CAT123khg","B.?T.*").ToString());
BeforeAfter
str = FormatDateTime(d, vbGeneralDate)
str = FormatDateTime(d, vbLongDate)
str = FormatDateTime(d, vbShortDate)
str = FormatDateTime(d, vbLongTime)
str = FormatDateTime(d, vbShortTime)
str = d.ToString();
str = d.ToLongDateString();
str = d.ToShortDateString();
str = d.ToLongTimeString();
str = d.ToString("HH:mm");