regsub and xlateOutVals

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf regsub and xlateOutVals

  • Creator
    Topic
  • #49065

    Is it possible to do a regsub in an xlate all on one line (w/o using a “;”)?

    Two lines …

    Code:

    regsub {_} [lindex $xlateInVals 0] { } xlateOutVals
    set xlateOutVals [list $xlateOutVals]

    This obviously doesn’t work (regsub returns a 1), but I’m pulling out my hair try to figure out how to make it work …

    Code:

    set xlateOutVals [list [regsub {_} [lindex $xlateInVals 0] { } xlateOutVals]]

    -- Max Drown (Infor)

Viewing 5 reply threads
  • Author
    Replies
    • #60605
      Kathy Riggle
      Participant

        Max,

        What does your xlateInVal look like?

        Kathy

      • #60606

        It could be anything. I want to remove underscores. An example would be “CP_BLAH”.

        -- Max Drown (Infor)

      • #60607
        Kathy Riggle
        Participant

          If you just need to remove all underscores, will this work?

          regsub -all — {_} $xlateInVals {} xlateOutVals

        • #60608

          I’m replacing underscores with spaces which effectively creates a list. xlateOutVals is a list variable in Cloverleaf.

          The two lines of code listed above works well. I’m just curious about how to get it all on one line.

          -- Max Drown (Infor)

        • #60609
          Jim Kosloskey
          Participant

            Max,

            Try this:

            set xlateOutVals

              ]]

              Jim Kosloskey

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

            1. #60610

              Groovy. Thanks!

              -- Max Drown (Infor)

          Viewing 5 reply threads
          • The forum ‘Cloverleaf’ is closed to new topics and replies.