How can I use variable to define PATH?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf How can I use variable to define PATH?

  • Creator
    Topic
  • #47974
    Jae Joo
    Participant

      Hi,

      I do have a problem to use variable to define PATH.

      For example,

      set idx 1

      set status [datget [grmfetch $ghd {1($idx).PID(0).00581(0).[0]}] VALUE]

      it returned 1(0).PID.00581(0).[0].

      Does anyone know why?

      Jae

    Viewing 2 reply threads
    • Author
      Replies
      • #57210
        Robert Kersemakers
        Participant

          Hi Jae,

          I don’t think you can access a PATH in TCL anywhere in Cloverleaf. You can only use a PATH as a variable in your translation.

          If you want to use a variable in a PATH, you can do it like this (in a translation that is):

          Code:

          =0  –>  $%g1
          1(%g1).PID(0).00581(0).[0]  –>  @whatever

          This way you can use variable %g1 in your PATH. Always remember to use $%g1 to change the value of %g1.

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #57211
          Jim Kosloskey
          Participant

            I will take a stab at this.

            Perhaps your problem is you have the path enclosed in curly braces. With that I think your variable is not getting a value substituted for it so the path when grm gets it actually has the variable name and not the numeric value associated with the variable name.

            Have you tried quote instead of curly brace?

            Jim Kosloskey

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

          • #57212
            Jae Joo
            Participant

              Thanks Jim

              set status [datget [grmfetch $ghd “1($idx).PID(0).00581(0).[0]”] VALUE]

              Jae

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