Strings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel N

    #1

    Strings

    Is there a way of setting the string Wildcard to true for multiple scenarios
    such as;

    Dim Wildcard As String

    If Wildcard = "This" And Wildcard = "That" Then

    'Do stuff here

    End If


  • Herfried K. Wagner [MVP]

    #2
    Re: Strings

    "Daniel N" <DeezNuts@yahoo .comschrieb:
    Is there a way of setting the string Wildcard to true for multiple
    scenarios such as;
    >
    Dim Wildcard As String
    >
    If Wildcard = "This" And Wildcard = "That" Then
    >
    'Do stuff here
    >
    End If

    I recommend to describe what you want to archieve in more detail because
    it's unclear what you understand by the term "wildcard". The code inside
    the 'If' block shown above will never be executed because if the value of
    'Wildcard' is "This", it cannot be equal to "That".

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Daniel N

      #3
      Re: Strings

      Essentially I want a string to be able to define multiple instances. Similar
      to using the (*) while doing a search. I posted this in dotnet.general:

      hWnd = FindWindow("CLA SS NAME", *)
      A string must be where the (*) is. Is there a way of making some kind of
      wildcard so that function accepts every string instance?

      To which someone replied;I should use the EnumWindows API along with the
      GetClassName API.

      But , after googleing I found
      :http://www.vbaccelerator.com/home/vb...ws/article.asp
      But still have no idea what do.




      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
      news:ewU5uAouGH A.4544@TK2MSFTN GP04.phx.gbl...
      "Daniel N" <DeezNuts@yahoo .comschrieb:
      >Is there a way of setting the string Wildcard to true for multiple
      >scenarios such as;
      >>
      >Dim Wildcard As String
      >>
      >If Wildcard = "This" And Wildcard = "That" Then
      >>
      >'Do stuff here
      >>
      >End If
      >
      >
      I recommend to describe what you want to archieve in more detail because
      it's unclear what you understand by the term "wildcard". The code inside
      the 'If' block shown above will never be executed because if the value of
      'Wildcard' is "This", it cannot be equal to "That".
      >
      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Strings

        Daniel,

        This answer from you we have seen now twice, but it does probably for
        nobody describe what you want to doe.

        As Herfried already wrote (in another way) in an earlier message. A string
        can contain any collection of characters,

        A string is nothing more than an address in memory with a certain lenght. In
        the positions of that it is possible to set that collection of charecters
        (unicode) which exist per character of two bytes.

        A wildcard has nothing to do with that.

        Cor

        "Daniel N" <DeezNuts@yahoo .comschreef in bericht
        news:XORBg.2953 $3U4.2018@fe12. lga...
        Essentially I want a string to be able to define multiple instances.
        Similar to using the (*) while doing a search. I posted this in
        dotnet.general:
        >
        hWnd = FindWindow("CLA SS NAME", *)
        A string must be where the (*) is. Is there a way of making some kind of
        wildcard so that function accepts every string instance?
        >
        To which someone replied;I should use the EnumWindows API along with the
        GetClassName API.
        >
        But , after googleing I found
        :http://www.vbaccelerator.com/home/vb...ws/article.asp
        But still have no idea what do.
        >
        >
        >
        >
        "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
        news:ewU5uAouGH A.4544@TK2MSFTN GP04.phx.gbl...
        >"Daniel N" <DeezNuts@yahoo .comschrieb:
        >>Is there a way of setting the string Wildcard to true for multiple
        >>scenarios such as;
        >>>
        >>Dim Wildcard As String
        >>>
        >>If Wildcard = "This" And Wildcard = "That" Then
        >>>
        >>'Do stuff here
        >>>
        >>End If
        >>
        >>
        >I recommend to describe what you want to archieve in more detail because
        >it's unclear what you understand by the term "wildcard". The code inside
        >the 'If' block shown above will never be executed because if the value of
        >'Wildcard' is "This", it cannot be equal to "That".
        >>
        >--
        >M S Herfried K. Wagner
        >M V P <URL:http://dotnet.mvps.org/>
        >V B <URL:http://classicvb.org/petition/>
        >
        >

        Comment

        • tommaso.gastaldi@uniroma1.it

          #5
          Re: Strings

          Perhaps he means comparing a string to a "template" provided by regular
          expression
          to see if it matches. In such a case, take a look at the "regex"
          object.

          -tom
          Cor Ligthert [MVP] ha scritto:
          Daniel,
          >
          This answer from you we have seen now twice, but it does probably for
          nobody describe what you want to doe.
          >
          As Herfried already wrote (in another way) in an earlier message. A string
          can contain any collection of characters,
          >
          A string is nothing more than an address in memory with a certain lenght. In
          the positions of that it is possible to set that collection of charecters
          (unicode) which exist per character of two bytes.
          >
          A wildcard has nothing to do with that.
          >
          Cor
          >
          "Daniel N" <DeezNuts@yahoo .comschreef in bericht
          news:XORBg.2953 $3U4.2018@fe12. lga...
          Essentially I want a string to be able to define multiple instances.
          Similar to using the (*) while doing a search. I posted this in
          dotnet.general:

          hWnd = FindWindow("CLA SS NAME", *)
          A string must be where the (*) is. Is there a way of making some kind of
          wildcard so that function accepts every string instance?

          To which someone replied;I should use the EnumWindows API along with the
          GetClassName API.

          But , after googleing I found
          :http://www.vbaccelerator.com/home/vb...ws/article.asp
          But still have no idea what do.




          "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
          news:ewU5uAouGH A.4544@TK2MSFTN GP04.phx.gbl...
          "Daniel N" <DeezNuts@yahoo .comschrieb:
          >Is there a way of setting the string Wildcard to true for multiple
          >scenarios such as;
          >>
          >Dim Wildcard As String
          >>
          >If Wildcard = "This" And Wildcard = "That" Then
          >>
          >'Do stuff here
          >>
          >End If
          >
          >
          I recommend to describe what you want to archieve in more detail because
          it's unclear what you understand by the term "wildcard". The code inside
          the 'If' block shown above will never be executed because if the value of
          'Wildcard' is "This", it cannot be equal to "That".
          >
          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://classicvb.org/petition/>

          Comment

          • Herfried K. Wagner [MVP]

            #6
            Re: Strings

            "Daniel N" <DeezNuts@yahoo .comschrieb:
            Essentially I want a string to be able to define multiple instances.
            Similar to using the (*) while doing a search. I posted this in
            dotnet.general:
            >
            hWnd = FindWindow("CLA SS NAME", *)
            A string must be where the (*) is. Is there a way of making some kind of
            wildcard so that function accepts every string instance?
            You can simply pass 'Nothing' or 'vbNullString' to the second parameter to
            find any window. However, I suggest to use 'EnumWindows' too:

            <URL:http://groups.google.d e/groups?q=dotnet +enumwindows+vb >

            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://classicvb.org/petition/>

            Comment

            • AMDRIT

              #7
              Re: Strings

              Baring regex, you can also achieve a like comparison with instring.

              if string.instr(0, strTempValue,"t his") >0 and
              string.instr(0, strTempValue,"t hat") >0 then
              'we have a this or that match
              end if

              regex might be a better way to go especially if you are searching for
              something a pattern th?t or th?s where ? is the wildcard.

              <tommaso.gastal di@uniroma1.itw rote in message
              news:1155017437 .989960.179030@ 75g2000cwc.goog legroups.com...
              Perhaps he means comparing a string to a "template" provided by regular
              expression
              to see if it matches. In such a case, take a look at the "regex"
              object.
              >
              -tom
              Cor Ligthert [MVP] ha scritto:
              >
              >Daniel,
              >>
              >This answer from you we have seen now twice, but it does probably for
              >nobody describe what you want to doe.
              >>
              >As Herfried already wrote (in another way) in an earlier message. A
              >string
              >can contain any collection of characters,
              >>
              >A string is nothing more than an address in memory with a certain lenght.
              >In
              >the positions of that it is possible to set that collection of charecters
              >(unicode) which exist per character of two bytes.
              >>
              >A wildcard has nothing to do with that.
              >>
              >Cor
              >>
              >"Daniel N" <DeezNuts@yahoo .comschreef in bericht
              >news:XORBg.295 3$3U4.2018@fe12 .lga...
              Essentially I want a string to be able to define multiple instances.
              Similar to using the (*) while doing a search. I posted this in
              dotnet.general:
              >
              hWnd = FindWindow("CLA SS NAME", *)
              A string must be where the (*) is. Is there a way of making some kind
              of
              wildcard so that function accepts every string instance?
              >
              To which someone replied;I should use the EnumWindows API along with
              the
              GetClassName API.
              >
              But , after googleing I found
              :http://www.vbaccelerator.com/home/vb...ws/article.asp
              But still have no idea what do.
              >
              >
              >
              >
              "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
              news:ewU5uAouGH A.4544@TK2MSFTN GP04.phx.gbl...
              >"Daniel N" <DeezNuts@yahoo .comschrieb:
              >>Is there a way of setting the string Wildcard to true for multiple
              >>scenarios such as;
              >>>
              >>Dim Wildcard As String
              >>>
              >>If Wildcard = "This" And Wildcard = "That" Then
              >>>
              >>'Do stuff here
              >>>
              >>End If
              >>
              >>
              >I recommend to describe what you want to archieve in more detail
              >because
              >it's unclear what you understand by the term "wildcard". The code
              >inside
              >the 'If' block shown above will never be executed because if the value
              >of
              >'Wildcard' is "This", it cannot be equal to "That".
              >>
              >--
              >M S Herfried K. Wagner
              >M V P <URL:http://dotnet.mvps.org/>
              >V B <URL:http://classicvb.org/petition/>
              >
              >
              >

              Comment

              Working...