Re: ASCII code

From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 02/12/04


Date: Thu, 12 Feb 2004 07:37:45 -0600

Tom,
> It doesn't... See, a long time ago - when I was first learning .NET,
> ...
> I seem to remember & and &= being one of those cases, but the
> OP as proven that to be mistaken...
I don't know if the OP has proven that it never does! He has simple
confirmed my statement ;-)

I suspect you saw & and &= call into the runtime, when VB.NET was converting
one of the arguments to String!

For example the following calls functions in
Microsoft.VisualBasic.CompilerServices namespace in the
Microsoft.VisualBasic assembly:

    Dim i As Integer
    Dim ch As Integer
    Dim s As String

    s &= ch & i

To convert the ch & i variables to strings, then it calls String.Concat.

Although in the above case, VB.NET could simply call the String.Concat that
accepted Objects, and box i & ch...

Hope this helps
Jay

"Tom Shelton" <tom@mtogden.com> wrote in message
news:eofisuS8DHA.2416@TK2MSFTNGP10.phx.gbl...
> On 2004-02-12, Jay B. Harlow [MVP - Outlook] <Jay_Harlow_MVP@msn.com>
wrote:
> > Tom,
> >> Interesting... I've never really tried rotor, so I wasn't sure how that
> >> would work. Another place you may have trouble is with the string
> >> concatenation operators (&, &=). I believe these make calls into the
> >> VB.NET runtime library. So, you'll want to use String.Concat instead.
> >
> > I've only seen & and &= use String.Concat, I've never seen them use a
VB.NET
> > specific routine.
> >
> > However I'm not saying they don't!
> >
> > Jay
>
> It doesn't... See, a long time ago - when I was first learning .NET,
> I used to always remove the reference to Microsoft.VisualBasic. I don't
> remember the context, but I was in a discussion once were it was
> revealed to me about the automatic inclusion by the compiler. I started
> playing around with using ILDASM to generate il files, removing the
> reference, and then using ILASM to regenerate the assemblies. In the
> process I found several situations where the compiler inserted calls to
> some Microsoft.VisualBasic.CompilerHelper class (or something like that,
> it's been a couple of years ago, so I don't remember all of the
> details). I seem to remember & and &= being one of those cases, but the
> OP as proven that to be mistaken... For all I know, that could have
> been during the Beta or RC days, and it has since changed during release
:)
>
> --
> Tom Shelton [MVP]
> Powered By Gentoo Linux 1.4
> "Zaphod grinned two manic grins, sauntered over to the bar
> and bought most of it."
>
> - Zaphod in paradise.



Relevant Pages

  • Re: Eval code and AppDomains
    ... Do you know of any other way to Eval a String to get a Boolean result other ... >> Dim objEval As New EvalProvider ... >> Imports Microsoft.VisualBasic ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Can RCW and CCW be used together?
    ... component project reference to my client project and build. ... Dim iads As IadsAutomationLib.Application ... problem-domain specific assemblies and the assemblies for the RCW-Interop ...
    (microsoft.public.dotnet.framework.interop)
  • Re: My VB6 MS Word VBA code crashes Word - Word97
    ... The reason you can't go backwards (that is, compile with a reference to Word ... Dim oWord As Word.Application ' Note early bound is OK here! ... Set oDocuments = oApplication.Documents ' Note this is an early bound ... >>> Dim Firstname As String ...
    (microsoft.public.word.vba.general)
  • Re: Eval code and AppDomains
    ... Crossing app domains and generating these assemblies ... > I needed a way to Eval this string and return a Boolean result. ... > Dim objEval As New EvalProvider ... > sb.Append("Imports System.Data" & vbCrLf) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: String Reference Type
    ... Dim x As New MyInt ... The 'pointer' (lets call it a reference shall we) returned by the New ... Therefore its always allocated in the heap and a variable of string type is ...
    (microsoft.public.dotnet.framework.aspnet)