Abubakar,
thanx for the nice reply and I understand your confusion about y I would
want to avoid it. Actually as a developer in a software company I'm a big
fan of C# but I 'm sometimes forced to use vb.net for some apps/libs by my
I'm not the one who is confused here! ;-)
Did you read the part about how ChrW & AscW will create IL directly, no
function calls involved?
If ChrW & AscW does not generate a call to a DLL, you should be able to
safely use them on Rotor... Of course sometimes ChrW & AscW does generate
the function call...
I say "should be able to" as I don't know if the Rotor loader looks for the
referenced assembly when it loads the primary assembly, or it looks for the
referenced assembly when it uses the assembly. The regular Framework (for
Win32) looks for the assembly when it JIT's a function that uses the
assembly.
Personally if running my VB.NET programs on Rotor or Mono was a requirement,
I would ensure that there was a version of the Microsoft.VisualBasic
assembly (at least the part that I use) available on that platform, even if
I needed to implement that part myself. It appears that
www.go-mono.com is
61% complete with their implementation of Microsoft.VisualBasic...
I believe your confusion is steaming from you consider ChrW to be a VB.NET
specific library function, I consider it a VB.NET "keyword" (yes I know it
is not an actual keyword). I would use ChrW where you were using Casting in
your other example... Maybe this is where you think I'm confused.
I suspect the other part you are confused about is the name VisualBasic in
Microsoft.VisualBasic.DLL. Despite the VisualBasic in the name I consider
them to be an extended runtime available to any .NET language, including C#!
The way I am reading your message is: I need to use VB.NET, however I only
want to use a limited (suboptimal) subset, which to me is naive. However I
can understand your reasons for thinking that way.
I say suboptimal subset, as I suspect you also avoid actual keywords, such
as CType, CInt, CSng and the like that call into Microsoft.VisualBasic.DLL.
At least if you don't based on your explanations you may want to start!
IMHO its "better" to fully learn a language so that I can fully leverage the
language, rather then going out of my way to avoid features that enable me
to more quickly write programs!
Don't get me wrong, I like to know what VB.NET's runtime is doing and how to
do it in the Framework itself and I may choose the Framework method over the
runtime function. I just do not agree with "I need to avoid VB.NET features,
at all cost!" mentality! As a lot of times the VB.NET's runtime functions do
it with significantly "less pain for the gain", which means that I can call
a simple runtime function (which again ARE usable in C#!) or I can write the
"same" function myself.
Hope this helps
Jay