Pass multiple arguments?

Clovertech Forums Read Only Archives Cloverleaf Tcl Library Pass multiple arguments?

  • Creator
    Topic
  • #54086
    Dustin Sayes
    Participant

      How can I pass multiple arguments to my tps?

      In the .tcl that I have posted here, I can pass 1 argument.

      The variable name is uargs.

      My end goal here is to have 1 TPS for filter patient age. Then, I can use 1 tps, for filter age, and simply pass min/max age range to the tps, for each treads need.

      Specifically :

      #########

      # Here I am looking for Max and Min Age

      #Currently

    Viewing 2 reply threads
    • Author
      Replies
      • #80106
        Dustin Sayes
        Participant

          Just to be clear.

          I want to pass 2 values/arguments -> 2 unique variables

          Keylist?

        • #80107
          Brian Hochenedel
          Participant

            You would pass in the arguments using the format:

            Code:

               {DEBUG 1}
               {MINAGE 18}
               {MAXAGE 65}


            Then, in the code you would do something like:

            Code:

               #Set default arguments in case you forget to pass args
               set uargs {}
               set debug 0    
               set minage 0
               set maxage 100

               #Get the user arguments from args
               keylget args ARGS uargs

               #Get each individual key/value pair argument from uargs
               catch {keylget uargs DEBUG debug}   ;#Overrides the default if supplied
               catch {keylget uargs MINAGE minage} ;#Overrides the default if supplied
               catch {keylget uargs MAXAGE maxage} ;#Overrides the default if supplied


            Hope that helps  :D.

            -Brian Hochenedel

          • #80108
            Dustin Sayes
            Participant

              Brian!! Thank you!!

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