Case insensitive tbllookup

Clovertech Forums Cloverleaf Case insensitive tbllookup

Tagged: 

  • Creator
    Topic
  • #113777
    Usman Azher
    Participant

      Is there a way to do a table lookup without worrying about case sensitivity?

    Viewing 1 reply thread
    • Author
      Replies
      • #113778
        Jim Kosloskey
        Participant

          You can invoke a Tcl XPM Type proc to possibly influence that (using tbllookup) but other than ‘normalizing’ the table entries to a particular case (like all lower or all upper) then use the STRING Action (strtoupper or strtolower functions) or Tcl to convert the source field to a matching case prior to lookup I don’t know of any option included in the actual TABLE Action. At least up to release 6.2.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #113779
          Paul Bishop
          Participant

            The tbllookup command itself does not have a flag to make it case insensitive and the GUI doesn’t have a flag either.

            What I do for a translate is copy the value I’m looking up into a variable with some tcl code to convert it to either all upper case or all lower case (string toupper/string tolower), and then use that variable in the table lookup.

            For TCL programs, I just wrap the lookup field in a string command:

            set table_result [tbllookup my_table.tbl [string tolower $lookup_string]]

            Paul Bishop
            Carle Foundation Hospital
            Urbana, IL

        Viewing 1 reply thread
        • You must be logged in to reply to this topic.