Focus issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Flechsenhaar

    Focus issue

    I am tryign to pull the IP address from a Database field, take the first
    3 octets and contenate them with ".255" My suppervisor wants this
    achived this by setting focus to the 3rd "." and trimming right of it. I
    am fairly new to VB programming however, being a network specilist prior
    and cant find the command to set focus at the "."

    Any guideance would be greatly apprecited.

    *** Sent via Developersdex http://www.developersdex.com ***
  • Jack Jackson

    #2
    Re: Focus issue

    On Mon, 03 Nov 2008 08:54:03 -0800, Jim Flechsenhaar
    <frontdesk@orle ansny.comwrote:
    >I am tryign to pull the IP address from a Database field, take the first
    >3 octets and contenate them with ".255" My suppervisor wants this
    >achived this by setting focus to the 3rd "." and trimming right of it. I
    >am fairly new to VB programming however, being a network specilist prior
    >and cant find the command to set focus at the "."
    >
    >Any guideance would be greatly apprecited.
    >
    >*** Sent via Developersdex http://www.developersdex.com ***
    I'm not sure what you mean by "setting focus". Normally setting
    focus means setting input focus on a visual form.

    If you have the text IP address in a variable:

    Dim ip As String = "1.21.35.44 "
    Dim indx As Integer = ip.LastIndexOf( ".")

    If indx >= 0 Then
    ip = ip.Substring(0, indx + 1) + "255"
    End If

    Comment

    • Mark S. Milley

      #3
      Re: Focus issue

      Hi Jim -

      You didn't specify if which version of vb you were using.

      VB6
      dim ipaddr as string = "1.2.3.4"
      ipaddr=left(ipa ddr,instrrev(ip addr,".")) & ".255"
      MsgBox(ipaddr) 'Displays 1.2.3.255

      VB.NET
      Dim ipaddr As String = "1.2.3.4"
      ipaddr = ipaddr.Substrin g(0, ipaddr.LastInde xOf(".")) & ".255"
      MsgBox(ipaddr) 'Displays 1.2.3.255

      Happy Coding,

      -Mark
      "Jim Flechsenhaar" <frontdesk@orle ansny.comwrote in message
      news:OpBnHTdPJH A.4608@TK2MSFTN GP06.phx.gbl...
      >I am tryign to pull the IP address from a Database field, take the first
      3 octets and contenate them with ".255" My suppervisor wants this
      achived this by setting focus to the 3rd "." and trimming right of it. I
      am fairly new to VB programming however, being a network specilist prior
      and cant find the command to set focus at the "."
      >
      Any guideance would be greatly apprecited.
      >
      *** Sent via Developersdex http://www.developersdex.com ***

      Comment

      • rowe_newsgroups

        #4
        Re: Focus issue

        You didn't specify if which version of vb you were using.

        Seeing how he's in the vb.net newsgroup it should be easy to figure
        out which to post.

        :-)

        Thanks,

        Seth Rowe [MVP]

        Comment

        • Mark S. Milley

          #5
          Re: Focus issue

          Yeah, but he seemed a bit new to programming in general.

          For all I know he may have been looking for an answer in VBA.

          Cheers,

          -M

          "rowe_newsgroup s" <rowe_email@yah oo.comwrote in message
          news:e37d7d85-6f34-470b-85aa-36e07b240b7e@i2 4g2000prf.googl egroups.com...
          >You didn't specify if which version of vb you were using.
          >
          Seeing how he's in the vb.net newsgroup it should be easy to figure
          out which to post.
          >
          :-)
          >
          Thanks,
          >
          Seth Rowe [MVP]
          http://sethrowe.blogspot.com/

          Comment

          • rowe_newsgroups

            #6
            Re: Focus issue

            For all I know he may have been looking for an answer in VBA.

            You miss the point, if a post is in a .NET group, responses should be
            about .NET. As when people down the line come to search for .NET
            answers, they will find only appropriate code samples.

            In other words, if a new programmer, which we often see here, asks a
            question and mentions no specific programming language, it shouldn't
            be assumed that he/she should get C#, VB, Java, or Boo answers, a
            simple VB.NET answer will suffice.

            Anyways, not trying to police the board or say your answer wasn't
            appreciated, just saying that wasn't necessary to give a classic VB
            and VB.NET example.

            Thanks,

            Seth Rowe [MVP]


            Comment

            • Mark S. Milley

              #7
              Re: Focus issue


              Hi Seth -

              I'm sure you've worked tech support before--it's not safe to assume that the
              user even has the computer plugged in. I always approach helping others with
              that mindset. With all respect to Jim, this question was a pretty basic one.
              Given that this question came from an apparent novice, and we have no
              pre-existing knowledge of what Jim's level of expertise is, it's completely
              illogical to assume that he was using VB.NET, when he could just as well
              have been using VBA, VB6, or VBS. Of course I completely understand that
              this is a VB.NET forum, yet neither of us should assume that Jim knew that,
              or that he even knew that there IS a difference between the versions of VB.
              His original post offered no hints or code snippets which would have
              indicated any one version over the another. It may have been is first week
              of programming ever and/or his first newsgroup post ever. Even experienced
              people often post on the wrong newsgroup.

              I don't understand how my giving an example in both flavors of VB, just in
              case, has ruffled your feathers enough that you felt it necessary to
              publically point out what you feel is my mistake. Everyone here is either
              seeking help, or voluntarily offering help; and, honestly, I could care less
              if the advise I offered this gentleman did not fit your apparently strict
              notions of what good help should look like. You may be an "MVP", but the
              fact that you have given more of your time to help others on here than I
              have doesn't equate to a mandate to correct other people's posts. Honestly,
              all you're doing in post like your last one is discouraging me and other
              good-hearted, intelligent people from volunteering their time and expertise
              to try help others.

              Again, all I did was provide additional information which, even if it does
              not help this gentleman, may help someone else in the future who stumbles
              upon it. If your having to skim over these additional few lines of code
              bothered you that much then, with all due respect sir, you really need to
              get over yourself.

              Good Day,

              -Mark




              "rowe_newsgroup s" <rowe_email@yah oo.comwrote in message
              news:b1cece88-9530-476a-97dd-36e701c0a311@n3 3g2000pri.googl egroups.com...
              >For all I know he may have been looking for an answer in VBA.
              >
              You miss the point, if a post is in a .NET group, responses should be
              about .NET. As when people down the line come to search for .NET
              answers, they will find only appropriate code samples.
              >
              In other words, if a new programmer, which we often see here, asks a
              question and mentions no specific programming language, it shouldn't
              be assumed that he/she should get C#, VB, Java, or Boo answers, a
              simple VB.NET answer will suffice.
              >
              Anyways, not trying to police the board or say your answer wasn't
              appreciated, just saying that wasn't necessary to give a classic VB
              and VB.NET example.
              >
              Thanks,
              >
              Seth Rowe [MVP]

              >

              Comment

              • Mike Williams

                #8
                Re: Focus issue

                "rowe_newsgroup s" <rowe_email@yah oo.comwrote in message
                news:b1cece88-9530-476a-97dd-36e701c0a311@n3 3g2000pri.googl egroups.com...
                You miss the point, if a post is in a .NET group, responses
                should be about .NET. As when people down the line come
                to search for .NET answers, they will find only appropriate
                code samples.
                I wish you'd tell Bill McCarthy that because he's been infesting the VB6
                group for months deliberately posting .Net answers on the Classic VB (VB6
                and below) group and he's been doing it deliberately to annoy people!

                Mike



                Comment

                Working...