Homepage › Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Can I use a variable within the Path? › Reply To: Can I use a variable within the Path?
Assume you are passing a value in and a cnt in @ cnt in that order. The ob address is the base address to store the data plus @cnt for update.
# Get the value and the cout
lassign $xlateInVals val cnt
# Get the two OB addresses
lassign $xlateOutList valAddr cntAddr
# Assume you know address is something like :
# 0(0).PID(0).00133 and you want it to be
# 0(0).PID(CTR).00133
regsub — {PID(0)} $valAddr “PID($cnt)” valAddr
# Increment the counter
incr cnt
# store the count
xpmstore $xlateId $cntAddr c $cnt
# Store the value
xmpstore $xalteId $valAddr c $val
This is off the top of my head. I think its right but I may have fat-fingered something.