TCL Fragment error Cloverleaf 5.8 – TCL 8.4v

Homepage Clovertech Forums Read Only Archives Cloverleaf Tcl Library TCL Fragment error Cloverleaf 5.8 – TCL 8.4v

  • Creator
    Topic
  • #53953
    Lawrence Nelson
    Participant

    I’m new here so please forgive me if I’m posting improperly.

    I have a simple TCL fragment in an Xlate

    ############################

    Source  

    0(0).PID(0).#5(0).[0]

    Pre Proc

    set xlateOutVals [string range $xlateInVals 0 0 ]

    Destination

    @lastname

    ############################

    That throws this error when I run Routes on it –

    ###############

    [xpm :xlt :ERR /0:  UNNAMED_TID:12/10/2013 12:12:59] QDX_Tcl_SplitList({HOW) failed: unmatched open brace in list

    [xlt :xlat:ERR /0:  UNNAMED_TID:12/10/2013 12:12:59] [0.0.5] Xlate ‘to_NNOW_STABILIZED.xlt’ failed: Internal XPM Tcl error

    QDX_Tcl_SplitList failed:: unmatched open brace in list

    errorCode: NONE

    errorInfo:

    invalid command name “tix”

       while executing

    “tix option get fixed_font”

    ###############

    This should be a simple grab of the first 4 characters of the last name.

    When I change the fragment to

    set xlateOutVals [string range $xlateInVals 1 3 ]

    the error does NOT occur, but then again I’m not getting

    what I need…

    Thoughts on what I’m doing that the string range of that field is

    blowing things up?

    Thanks.

    Lawrence Nelson
    System Architect - MaineHealth IT

Viewing 4 reply threads
  • Author
    Replies
    • #79641
      Jerry Tilsley
      Participant

      The xlateInVals variable is a list not a string.

    • #79642
      Jim Kosloskey
      Participant

      Lawrence,

      As Jerry indicates refer to the xlste Lists as lists.

      However, I am not sure that is what is causing the error to be thrown.

      What release of Cloverleaf?

      Is this this error experienced running through the Xlate testing tool?

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

    • #79643
      Lawrence Nelson
      Participant

      Hi –

      Jerry –

      I’m not understanding how the lindex will give me the first 4 characters of the variable

      Jim –

      Cloverleaf 5.8 – TCL 8.4v  –  yes the routes through the xlate test testing tool

      Other –

      I’ve also determined that the field has a space in it

      |DOE JR^JOHN^^^^|

      Lawrence Nelson
      System Architect - MaineHealth IT

    • #79644
      Jim Kosloskey
      Participant

      Lawrence,

      The space in the Last Name (the component you are referencing) is a list separator character in Tcl.

      Because the Xlate treats your Source and Destination Elements as lists you need to as well otherwise you will either not get what you want or get the error you are seeing.

      Try this:

      lreplace xlateOutVals 0 0 [string range [lindex $xlateinVals 0] 0 3]

      The lreplace replaces the first element in the Destination List.

      The lindex gets the first element of the Source List.

      The string range gets the first 4 characters of the data returned by the lindex.

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

    • #79645
      Lawrence Nelson
      Participant

      All set – Thanks for you time and assistance!

      Lawrence Nelson
      System Architect - MaineHealth IT

Viewing 4 reply threads
  • The forum ‘Tcl Library’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,129
Forums
28
Topics
9,301
Replies
34,448
Topic Tags
288
Empty Topic Tags
10