[mono-vb] Re: [Mono-devel-list] MSVB conversion from C# to Mbas status

Jambunathan K Jambunathan K <kjambunathan.devel@gmail.com>
Tue, 22 Feb 2005 17:41:59 +0530


Dennis

Hey I never expected to hear so soon from you ;-)

> 5) Some files crash mbas with internal compiler errors. Some or all of these
> could be caused by illeage syntax in the converted code. 

These you can track by passing in --stacktrace option to mbas. ie.,
mbas --stacktrace file.vb

> 8) In at least one case, the converter uses the MSVB function it is
> converting to do the converting. WE use Cint(mychar) in a char to int
> conversion. The Cint function is replaced with the MSVB function. I expect
> to replace this with a call to System.Convert, with changes as needed to get
> the same behavior. 

Does your converter support translations that have "Option Strict On"
turned on the converted file. If the converter does support this
option, then you could minimize some of these hassles. (Just spitting
words off the top of my head ;-) with no deeper thought) Btw, "Option
Strict" is Off by default unless explicitly specified.

> 9) Some classes have no namespace declared. 

This is true for FileSystem module. It has been pending for sometime
now. We should be able to catch these easily from the MSVB's class
status page.

> It will probably be a week or two before I do much more on this. At that
> point, I will probably fix #7, 8, 9, 10 in the SVN C# code, and file some
> bugs with the converter tool people. 

Welcome !


Just some trivial heads up on some things that you might want to keep
a watch on ;-)

1) C# has no notion of Modules. And most of the MSVB namespace is
composed of Modules. (Class Status page should help here. Just look
for all classes that have an extra private constructor defined ....)

2) C# has no notion of DefaultParameters. There is a new Attribute
(Mono specific attribute) that I added to all methods that take
default parameter values. Link to my earlier blog
http://www.gnomebangalore.org/?q=node/view/498 has all the required
info on this front.

> 3) At some point I will (should ;)) make test cases for related mbas issues.

You might want to make use of the Mainsoft test cases in MSVB
directory to assess the immediate progress.

Cheers,
Jambunathan K.



On Mon, 21 Feb 2005 22:40:16 -0800 (PST), Dennis Hayes
<denisraytek@yahoo.com> wrote:
> 
> 
> These 28 files convert easily 
> 
> AppWinStyle.vb
> AssemblyInfo.vb
> BooleanType.vb
> ByteType.vb
> CallType.vb
> ComClassAttribute.vb
> CompareMethod.vb
> DateFormat.vb
> DateInterval.vb
> DateType.vb
> DefaultArgumentValueAttribute.vb
> DoubleType.vb
> DueDate.vb
> FirstDayOfWeek.vb
> FirstWeekOfYear.vb
> Globals.vb
> MsgBoxResult.vb
> MsgBoxStyle.vb
> OpenMode.vb
> OptionCompareAttribute.vb
> OptionTextAttribute.vb
> SpcInfo.vb
> StandardModuleAttribute.vb
> TabInfo.vb
> TODOAttribute.vb
> VBErrors.vb
> VBFixedArrayAttribute.vb
> VBFixedStringAttribute.vb 
> 
>   
> 
> these 48 require significant effort (or depend on another file that requires
> effort) 
> 
> BaseVBFile.vb
> BinaryVBFile.vb
> CallType.vb
> CharArrayType.vb
> CharType.vb
> Collection.vb
> Constants.vb
> ControlChars.vb
> Conversion.vb
> DateAndTime.vb
> DecimalType.vb
> ErrObject.vb
> ExceptionUtils.vb
> FileAttribute.vb
> FileSystem.vb
> Financial.vb
> FlowControl.vb
> ForEachEnum.vb
> HostServices.vb
> IncompleteInitialization.vb
> Information.vb
> InputVBFile.vb
> IntegerType.vb
> Interaction.vb
> IVbHost.vb
> LateBinding.vb
> LongType.vb
> MsgBoxStyle.vb
> ObjectType.vb
> OpenAccess.vb
> OpenMode.vb
> OpenShare.vb
> OutPutVBFile.vb
> ProjectData.vb
> RandomVBFile.vb
> ShortType.vb
> SingleType.vb
> StaticLocalInitFlag.vb
> Strings.vb
> StringType.vb
> TriState.vb
> Utils.vb
> VariantType.vb
> VBBinder.vb
> VBFile.vb
> VBMath.vb
> VbStrConv.vb
> VBUtils.vb 
> 
> Top issues uncovered thus far 
> 
> 1) Mbas does not yet support #ifdef, easy to work around. 
> 
> 2) The converter converts else if to else if, works in VB, mbas requires
> single word elseif, easy to work around. The converter could do a better job
> on this as well. 
> 
> 3) Basic keywords used as variable names (example type enum has String as an
> entry) 
> 
> 4) Neither VB nor mbas supports some abstract get's. I think. I have not
> looked into these errors at all. 
> 
> 5) Some files crash mbas with internal compiler errors. Some or all of these
> could be caused by illeage syntax in the converted code. 
> 
> 6) Default objects cause errors. Could be mbas, the converter, or just
> something that needs to be done by hand. (".Length" is used with out an
> object i.e. not myobject.Length. In foreach loops?). 
> 
> 7) Assignments in expressions myfunction(x += 5). These will be some of the
> first changes I make in the C# code. 
> 
> 8) In at least one case, the converter uses the MSVB function it is
> converting to do the converting. WE use Cint(mychar) in a char to int
> conversion. The Cint function is replaced with the MSVB function. I expect
> to replace this with a call to System.Convert, with changes as needed to get
> the same behavior. 
> 
> 9) Some classes have no namespace declared. 
> 
> 10) Some classes import/uses their own namespace. 
> 
> It will probably be a week or two before I do much more on this. At that
> point, I will probably fix #7, 8, 9, 10 in the SVN C# code, and file some
> bugs with the converter tool people. 
> 
> Feasibility: 
> 
> 1) Looks good at some point. 
> 
> 2) Maturity of mbas will be the key constraint 
> 
> 3) At some point I will (should ;)) make test cases for related mbas issues.
> 
> 4) The tool does a good job of doing most of the conversion. Issues with
> mbas and the tool require some easy work arounds. Fewer than a dozen tough
> problems appear repeatedly. 
> 
> Dennis 
> 
>   
> 
>   
> 
>   
> 
>  
> 
>  
> 
> 
> 
>  ________________________________
> Do you Yahoo!?
>  Yahoo! Search presents - Jib Jab's 'Second Term' 
> 
>