Be nice

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ray at

    #16
    Re: Be nice


    "Bob Barrows" <reb01501@NOyah oo.SPAMcom> wrote in message
    news:up4Kf2GpDH A.2820@TK2MSFTN GP10.phx.gbl...
    [color=blue]
    >
    > Again: they didn't "+" is a perfectly good concatenation character in
    > vbscript. I've already posted a link to the documentation in this thread.
    >
    > That said, I always use "&" for concatenation in vbscript. This habit[/color]
    really[color=blue]
    > burns me when I'm writing jscript code ...[/color]

    Have you coded in php at all? That's the stupidest concatenator I've ever
    seen. . It goes against all my instincts, but that's just because I was
    raised in a Microsoft family, I guess.

    Ray at work


    Comment

    • Bob Barrows

      #17
      Re: Be nice

      Ray at <%=sLocation% > wrote:[color=blue]
      > "Bob Barrows" <reb01501@NOyah oo.SPAMcom> wrote in message
      > news:up4Kf2GpDH A.2820@TK2MSFTN GP10.phx.gbl...
      >[color=green]
      >>
      >> Again: they didn't "+" is a perfectly good concatenation character
      >> in vbscript. I've already posted a link to the documentation in this
      >> thread.
      >>
      >> That said, I always use "&" for concatenation in vbscript. This
      >> habit really burns me when I'm writing jscript code ...[/color]
      >
      > Have you coded in php at all?[/color]

      Nope.
      [color=blue]
      >That's the stupidest concatenator I've
      > ever seen. .[/color]

      Uuuum - what concatenator are you talking about?

      Bob

      --
      Microsoft MVP -- ASP/ASP.NET
      Please reply to the newsgroup. The email account listed in my From
      header is my spam trap, so I don't check it very often. You will get a
      quicker response by posting to the newsgroup.


      Comment

      • Ray at

        #18
        Re: Be nice


        "Bob Barrows" <reb01501@NOyah oo.SPAMcom> wrote in message
        news:Oq122NHpDH A.2528@TK2MSFTN GP10.phx.gbl...
        [color=blue][color=green]
        > > Have you coded in php at all?[/color]
        >
        > Nope.
        >[color=green]
        > >That's the stupidest concatenator I've
        > > ever seen. .[/color]
        >
        > Uuuum - what concatenator are you talking about?[/color]

        ..

        $var1="Bob";
        $var2="Barrows" ;
        $var3=$var1." ".$var2;

        Ray at work



        Comment

        • Aaron Bertrand - MVP

          #19
          Re: Be nice

          > $var3=$var1." ".$var2;

          Yeah, that's sexy.

          Uh, wait, no it's not.


          Comment

          • Bob Barrows

            #20
            Re: Be nice

            Ray at <%=sLocation% > wrote:[color=blue]
            > "Bob Barrows" <reb01501@NOyah oo.SPAMcom> wrote in message
            > news:Oq122NHpDH A.2528@TK2MSFTN GP10.phx.gbl...
            >[color=green][color=darkred]
            >>> Have you coded in php at all?[/color]
            >>
            >> Nope.
            >>[color=darkred]
            >>> That's the stupidest concatenator I've
            >>> ever seen. .[/color]
            >>
            >> Uuuum - what concatenator are you talking about?[/color]
            >
            > .
            >
            > $var1="Bob";
            > $var2="Barrows" ;
            > $var3=$var1." ".$var2;[/color]

            Ughhhh!

            Bob
            --
            Microsoft MVP -- ASP/ASP.NET
            Please reply to the newsgroup. The email account listed in my From
            header is my spam trap, so I don't check it very often. You will get a
            quicker response by posting to the newsgroup.


            Comment

            • William Tasso

              #21
              Re: Be nice

              Bob Barrows wrote:[color=blue]
              > Ray at <%=sLocation% > wrote:[color=green]
              >> "Bob Barrows" <reb01501@NOyah oo.SPAMcom> wrote in message
              >> news:Oq122NHpDH A.2528@TK2MSFTN GP10.phx.gbl...
              >>[color=darkred]
              >>>> Have you coded in php at all?
              >>>
              >>> Nope.
              >>>
              >>>> That's the stupidest concatenator I've
              >>>> ever seen. .
              >>>
              >>> Uuuum - what concatenator are you talking about?[/color]
              >>
              >> .
              >>
              >> $var1="Bob";
              >> $var2="Barrows" ;
              >> $var3=$var1." ".$var2;[/color]
              >
              > Ughhhh![/color]

              exactly ;o)

              $var1="Bob";
              $var2="Barrows" ;

              $var3 = $var1;
              $var3 .= " ";
              $var3 .= $var2;

              produces the same result

              --
              William Tasso - http://WilliamTasso.com


              Comment

              • Ray at

                #22
                Re: Be nice


                "William Tasso" <news27@tbdata. com> wrote in message
                news:eUSjq6HpDH A.2528@TK2MSFTN GP12.phx.gbl...
                [color=blue]
                >
                > exactly ;o)
                >
                > $var1="Bob";
                > $var2="Barrows" ;
                >
                > $var3 = $var1;
                > $var3 .= " ";
                > $var3 .= $var2;
                >
                > produces the same result[/color]

                This further exposes my mother tongue. I never think of the += type of
                things, even when I'm doing a set /a in a batch file. I suck.

                Ray at work


                Comment

                • George Hester

                  #23
                  Re: Be nice

                  Nope. No nulls.

                  --
                  George Hester
                  _______________ _______________ ____
                  "Bob Barrows" <reb01501@NOyah oo.SPAMcom> wrote in message news:#LKIe3GpDH A.3504@TK2MSFTN GP11.phx.gbl...
                  As previously noted in this thread, "+" and "&" handle Nulls differently. Is there a possibility that any of the fields in your recordset contain Null?

                  Bob Barrows

                  --
                  Microsoft MVP -- ASP/ASP.NET
                  Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup.
                  "George Hester" <hesterloli@hot mail.com> wrote in message news:eYVRjHBpDH A.2676@TK2MSFTN GP11.phx.gbl...
                  Response.Write iCnt + " <a href=""http://" + rs(1) + """ target=_new>" + rs(1) + "</a><BR>"


                  Response.Write iCnt & " <a href=""http://" & rs(1) & """ target=_new>" & rs(1) & "</a><BR>"
                  No problem.

                  Note there are enough strings in here to show that coersion should not be an issue.

                  --
                  George Hester
                  _______________ _______________ ____
                  "George Hester" <hesterloli@hot mail.com> wrote in message news:#LxHEhYoDH A.2772@TK2MSFTN GP10.phx.gbl...
                  It may help if someone at Microsoft knows how to write VBScript. Since when was "+" a string concatenation character in VBScript?



                  --
                  George Hester
                  _______________ _______________ ____

                  Comment

                  • Bob Barrows

                    #24
                    Re: Be nice

                    OK, you've intrigued me. I am going to try to reproduce this on my machine.
                    It's an Access database, right? Can you give me an example of the data that
                    produces this error... wait a minute. I bet I know what the issue is. Let me
                    go and test it. I'll be right back ...

                    No, that's not it. I thought that the failure to explicitly specify the
                    field's value property was causing the problem, i.e.:

                    Response.Write rs(0) + "<BR>"
                    vs
                    Response.Write rsFields(0).val ue + "<BR>"

                    but that turned out not to be the problem - both of these statements worked
                    well for me. So the only alternative is that in your table, rs(0) is not a
                    Text column. In fact, using a numeric column was the only way I could
                    reproduce your error:

                    rs.Open "SELECT NumberColumn FROM tblblogs",cn, _
                    ,,adCmdText
                    Response.Write rs(0) + "<BR>"

                    I made a mistake in my first reply in this thread. If you go back and
                    re-read the documentation
                    (http://msdn.microsoft.com/library/en...ncatenation.as
                    p), you will see that when a number and a string are the addends of the +
                    operator, addition is attempted, not concatenation. So,

                    Response.Write 1 + "<BR>"
                    will cause a type mismatch, since "<BR>" cannot be coerced to a number.

                    Response.Write 1 + "1"
                    will result in 2

                    Response.Write Cstr(1) + "1"
                    will result in "11"

                    To reiterate, when using the + operator, concatenation only occurs when both
                    addends are strings.

                    Using & will cause both addends to be converted to strings, no matter what
                    datatype they are initially, so concatenation will always occur.

                    HTH,
                    Bob Barrows

                    --
                    Microsoft MVP - ASP/ASP.NET
                    Please reply to the newsgroup. This email account is my spam trap so I
                    don't check it very often. If you must reply off-line, then remove the
                    "NO SPAM"


                    Comment

                    • Bob Barrows

                      #25
                      Re: Be nice

                      Bob Barrows wrote:[color=blue]
                      > Response.Write rsFields(0).val ue + "<BR>"
                      >[/color]
                      should be
                      Response.Write rs.Fields(0).va lue + "<BR>"


                      Comment

                      Working...