2 Replies Latest reply on Sep 23, 2011 4:03 AM by MikeTrotter

    Ignore characters in field for webviewer help

    MikeTrotter

      Title

      Ignore characters in field for webviewer help

      Post

      I have a table prepopulated with statute numbers of the format 13A-5-191. I have a webviewer that will go to a webpage based on the statute number ("www.somewebsite.com/"&STATUTENUMBER&".htm"). This works great except that occasionally I have a statute that is of the format 13A-5-191(a)(2). I need the webviewer to ignore the first occurrence of "(" and everything after.

      Ideas from the Guru's?

      Thanks in advance,

      Mike

        • 1. Re: Ignore characters in field for webviewer help
          alanfink@comcast.net

          Mike,

           

          If the format of the url is always the same, ie: always has the "(" as the first character to exclude and then take everything to the left, then try this.

           

          EXAMPLE USING STATUTENUMBER = "13A-5-191(a)(2)"

          1. You need to Find position of "("

          Position ( STATUTENUBMER ; "(" ; 1 ; 1 ) 

          Result = 10

          If there is no "(" the result will be 0

           

          2. Get all the characters left of the "(" by using the following.  It tests for the result of finding the position of "(".  If it is there than it takes that position -1 and all the characters to the left.  If it is not there, then it takes the left most 10000 characters which should be enough to cover the url.

           

          Left ( STATUTENUBMER ; If ( Position ( STATUTENUBMER ; "(" ; 1 ; 1 ) =0 ; 10000 ; Position ( STATUTENUBMER ; "(" ; 1 ; 1 ) -1 ) )

           

          So your calculation would be:

           

          "www.somewebsite.com/" & Left ( STATUTENUBMER ; If ( Position ( STATUTENUBMER ; "(" ; 1 ; 1 ) =0 ; 10000 ; Position ( STATUTENUBMER ; "(" ; 1 ; 1 ) -1 ) ) & ".htm"

           

          Hope that works..

           

          Alan

          • 2. Re: Ignore characters in field for webviewer help
            MikeTrotter

            Alan,

            That worked perfectly!

            Thank you