Xlate not working

Homepage Clovertech Forums Cloverleaf Xlate not working

  • Creator
    Topic
  • #117326
    Rich
    Participant

    Team,

    I’ve got a series of actions that should parse the phone number, and change it to (999)999-9999 format.  The actions aren’t working, and I don’t know why.  Code actions follow:

    Copy
    In: =(
    +
    0(0).PID(0).#13(0).[5]
    +
    =)

    Out: @AC

    xlateStrSubstring 0 end-4
    In: 0(0).PID(0).#13(0).[6]
    Out: @FFN

    xlateStrSubstring 3 end
    In: 0(0).PID(0).#13(0).[6]
    Out: @LFN

    Copy
    In: @AC
    +
    @FFN
    +
    =-
    +
    @LFN
    Out: 0(0).PID(0).#13(0).[0]

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

      I think you need to use CONCAT Action along with the STRING Action..

      1. Do the STRING Action Substring Function to place PID-13.6 (1-3) in @FFN
      2. Do the STRIBG Action Substring Function to place PID-13.6 (4-7) in @LFN
      3. Do a CONCAT with the following in the Source:
        1. =(
        2. PID-13.5
        3. =)
        4. @FFN
        5. =-
        6. @LFN

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

    • #117336
      Charlie Bursell
      Participant

      Why so convoluted?

      set nr [lindex $xlateInVals 0]

      # If valid number convert else just output what you got

      if {[string is digit -strict $nr] && [string length $nr] = 9]} {

      regexp — {^(\d{3})(\d{3})(\d{4})} $nr {} a b c
      set xlateoutVals

        }

         

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

    Forum Statistics

    Registered Users
    5,117
    Forums
    28
    Topics
    9,293
    Replies
    34,435
    Topic Tags
    286
    Empty Topic Tags
    10