COND doesn’t work

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf COND doesn’t work

  • Creator
    Topic
  • #53795
    Yuhong Snyder
    Participant

    what I am trying to do is very simple: if (@nCountCOM < @nMaxCOM) { to do}. I set nCountCom =0, nMaxCom =1, but this if word just doesn’t seem to work. anybody has any idea? this is the piece of my xlate { { OP COPY }    { ERR 0 }    { PRE {        set nCountCOM 0        set nCountINJ 0        set nCountDIS 0        set nMaxCOM 1        set nMaxINJ 5        set nMaxDIS 10        #echo nCountCOM:$nCountCOM        #echo nMaxCOM:$nMaxCOM    }}    { IN @null }    { OUT @null } } { { OP ITERATE }    { BASIS 4(0).DG1 }    { VAR %s2 }    { TYPE segment }    { BODY {        { { OP COMMENT }            { COMMENT {TODO: Insert new actions here} }        }        { { OP IF }            { ERR 0 }            { COND {@nCountCOM < @nMaxCOM} }            { THENBODY {                { { OP COMMENT }                    { COMMENT {TODO: Insert new actions here} }                }                { { OP COPY }                    { ERR 0 }                    { PRE {                        echo success                    }}                    { IN {} }                    { OUT {} }                }            }}            { ELSEBODY {            }}        }

Viewing 2 reply threads
  • Author
    Replies
    • #78954
      Jim Kosloskey
      Participant

      Try setting @nCountCom and @nMaxCOM like this:

      COPY =0 –> @nCountCom

      COPY =1 –> @nMaxCOM

      with Xlate COPY Actions instead of with the Tcl code you are using.

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

    • #78955
      Yuhong Snyder
      Participant

      Thanks, Jim.

      That works.  what’s the real difference here?

    • #78956
      Jim Kosloskey
      Participant

      The Tcl variables you set inside your proc are not known to the Xlate itself.

      That is why there are temp variables. You can reference the temp variables within your Tcl code but as elements of the xlateInVals, etc. not as Tcl variables.

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

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

Forum Statistics

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