[mono-vb] Mono 2.6.3 and performance
Kornél Pál
kornelpal at gmail.com
Wed Apr 21 04:56:54 EDT 2010
Hi,
nickntg wrote:
> ...
> I quickly discovered that I had to target Mono 2.6 in order to reach my
> goal, so I aimed for openSUSE 11.2 with Mono 2.6.3. Initially, my efforts
> failed because calls to the VB namespace were returning incorrect results. I
> had to replace a lot of CType, CInt, CBool, CByte, CLng, Asc, Chr method
> calls with calls to various classes of the System namespace. After some work
> at that, I was able to run the GUI application under openSUSE successfully.
> ...
Asc, Chr were almost completely rewritten by me a while ago and I have
added tests for all the 65536 code points so I believe your problems
result from different system encoding (code page) and culture (language)
settings.
Note that you should use AscW and ChrW that operate on Unicode code
points and are not affected by system settings.
Also note that CType, CInt, CBool, CByte, CLng use culture dependent
conversions. You should use Parse and TryParse methods with
CultureInfo.InvariantCulture of Integer, Boolean, Long, etc. types to
get culture independent conversions.
If you want to unbox value types, you can use DirectCast, that is the
most efficient way for unboxing. (Boxing is for example converting
Integer to Object. Unboxing is the reverse operation, but you cannot
unbox a String to Integer because that would require conversion.)
Kornél
More information about the Mono-vb
mailing list