calling a tcl proc with arguments from another tcl proc

Clovertech Forums Read Only Archives Cloverleaf Tcl Library calling a tcl proc with arguments from another tcl proc

  • Creator
    Topic
  • #51662
    Darshak Shah
    Participant

      I have a tcl proc which takes arguments to replace a value on a field, I have another tcl proc which loop thru a repeating segment and calls the first tcl proc with argument. I get the following error

      Tcl error:

      msgId = message0

      proc = ‘spuh_replace_fieldvaluein_repeatsegments’

      args = ‘{SEGMENTNAME OBX} {FIELDNUMBER 3_1} {VALUETOBEREPLACE &} {REPLACEVALUE \T\}’

      result = ‘can’t read “mode”: no such variable’

      errorInfo: ‘

      can’t read “mode”: no such variable

         while executing

      “switch -exact — $mode {

             start {

                 # Perform special init functions

                 # N.B.: there may or may not be a MSGID key in args

      …”

    Viewing 1 reply thread
    • Author
      Replies
      • #71167
        Robert Kersemakers
        Participant

          Hi Darshak,

          The tcl proc you are calling (and that you are showing) is a TPS proc. You can’t call this kind of proc from for another tcl proc: it is intended to process a message in a certain ‘mode’ (start or run).

          So you will need to extract the routine from this TPS proc and put it into for example an XLTP, depending on what you want to do.

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #71168
          Darshak Shah
          Participant

            Robert,

            Thank you.

            I just move the required code into first tcl proc.

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