tcl callout error – 3.8 to 5.5

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf tcl callout error – 3.8 to 5.5

  • Creator
    Topic
  • #49494
    Femina Jaffer
    Participant

    Hi everyone,

    I am getting the following error for my code snippet after converting from 3.8 to version 5.5.  Most of the code snippets are generating the same error after our conversion.  Please advise, as this is working the way it is in 3.8.

    Error:

    MESSAGE 1

    Tcl callout error

    erroCode: NONE

    errorInfo:

    invalid command name “xlt_fo_orc.tcl”

       while executing

    “xlt_fo_orc.tcl”

    The code is:

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

    # Name: fo_orc

    # Purpose:

    # UPoC type: xltp

    # Args: none

    # Notes: All data is presented through special variables.  The initial

    # upvar in this proc provides access to the required variables.

    #

    # This proc style only works when called from a code fragment

    # within an XLT.

    #

    # Created By Femina Jaffer on Feb. 7, 07:  This code fragment removes the “_”and                                            # everything after in the ORC 2 field for # Fast Orders. For example: 12345_fast# output after this code is 12345.      

    proc xlt_fo_orc {} {

       upvar xlateId         xlateId

     xlateInList   xlateInList

     xlateInTypes  xlateInTypes

     xlateInVals   xlateInVals

     xlateOutList  xlateOutList

     xlateOutTypes xlateOutTypes

     xlateOutVals  xlateOutVals

     lassign $xlateInVals data

        set xlateOutVals [string range $data 0 [string first “_” $data -1]]  

    }

    Thank you.

    Femina

Viewing 7 reply threads
  • Author
    Replies
    • #62215
      James Cobane
      Participant

      Femina,

      It looks like are trying to run the file (xlt_fo_orc.tcl) vs. the actual proc (xlt_fo_orc); make sure the Xlate is referencing the proc name (xlt_fo_orc).  You may also need to re-build/build the tclIndex file as you may have missed a step in the conversion from 3.8 to 5.5.

    • #62216
      Femina Jaffer
      Participant

      Thanks Jim.

      I had already rebuild the tclindex.  It is only when I call the code from the Xlate, that I get this error.

      In the Callout, I am just calling the name of the code “xlt_fo_orc”.

      Thanks

      fj

    • #62217
      Ed Mastascusa
      Participant

      Femina,

      it is always possible mktclindex didn’t work because there was a syntax error in the tcl file.

      Although nothing looks wrong in what you listed, I would suggest manually checking that your function exists. That way you can at least narrow down the likely cause to being either in the function itself or your translate file.

      to manually check set your site, then go into tcl and try the function from the command line.

      If you get an “invalid command name” error then your function isn’t being loaded by mktclindex

      If you call it w/ no parameters and the function exists then you should see an error to the effect that some variable doesn’t exist or that your passing the wrong numberof parameters.

      $ tcl

      tcl>echo $env(HCISITEDIR)

      /hci/qdx5.5/integrator/clprod

      tcl>qwertyuiop               ;# illustate a non-existent command

      Error: invalid command name “qwertyuiop”

      tcl>xltConvertDate         ;# this is valid in my system

      Error: can’t read “xlateInVals”: no such variable

    • #62218
      Bob Richardson
      Participant

      Greetings,

      You may wish to check the tclIndex file in your tclprocs directory for the proc name to verify that the index entry exists and with the correct name.

      For example with your proc, an entry like:

      set auto_index(xlt_fo_orc)

        ]

        would be there.

        I hope that this helps you out.

      1. #62219
        Robert Milfajt
        Participant

        I noticed something between 3.8 (our production) and 5.5 (our test).  In 5.5, under hcitcl shell, help lassign does not return any help but instead an error, although running the command from the shell works as one would expect.  Under 3.8, help lassign gives you the proper help.  In both 3.8 and 5.5, there is an hci provided extension, called assign_list, which seems to be the same thing as lassign.

        Of the code snippets that are not working, do they all contain the lassign command?  Of the ones that are working, are they missing the lassign command?  If you replace lassign with assign_list in the TCL you provided in your example, does it work?  (Remember to reload the TCL proc to your process).

        Hope this helps,

        Bob

        Robert Milfajt
        Northwestern Medicine
        Chicago, IL

      2. #62220
        Charlie Bursell
        Participant

        Help was part of the TclX interpreter.  When you ran hcitcl prior to Tcl 8.4 you ran the interpreter in TclX.  TclX was not updated along with 8.4.  Now TclX is a separate libarary and the hcitcl interpreter runs under tclsh.

        Also you will note that you no longer can run a script like:

                        hcitcl -f

      3. #62221
        Femina Jaffer
        Participant

        Thank you all for your help.  Much appreciated.

        It seemed that the problem was within the xlate itself.  In the copy where I am calling the code snippet, the source path was missing a “{” brace in front ( I noticed this from another COPY).  Anyway, I think this is usually placed automatically, but it was missing on this particular one.  Once I placed it back, it worked alright.  Go figure.

        Thanks again.

        fj

      4. #62222
        Jim Kosloskey
        Participant

        Femina,

        That is just one of the reasons we do not use XLTP ‘snippets’ imbedded in an Xlate.

        Instead we create a Tcl proc (easier to make it reusable that way as well) and invoke it from the Xlate Action (COPY, CALL, whatever).

        That way should we fumble finger the curly braces, square brackets, or any other Tcl sensitive encapsulation, the error we get is inside the module, not inside the Xlate.

        Jim Kosloskey

        email: jim.kosloskey@jim-kosloskey.com

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

    Forum Statistics

    Registered Users
    5,074
    Forums
    28
    Topics
    9,252
    Replies
    34,241
    Topic Tags
    275