12.4.35.7   %ROTATEMINUS

Decrements (decreases) tag by specified amount, percentage , tag value or script variable until OUTPLO (output low span) reached then resets counter to OUTPHI (output high span) minus the delta of the last increment above OutpLo. It carries over and difference between OutpLo and the last increment calculation. Repeats continuously. Similar to LOOPMINUS, but when OutpLo reached, next value is not necessarily equal to OutpHi.  This makes for smother animation of rotation if the increment is not an even multiple of the output span.

SETVAL {counter=%ROTATEMINUS 1}      # decrements tag named counter by 1

# until OutpLo reached

# then resets counter to OutpHi

# minus whatever remainder there was in the

# decrement below OutpLO. Repeats.

SETVAL {tag2=%ROTATEMINUS 1%}         # decrements tag2  by 1 percent of output

# span until OutpLO reached

# then resets counter to OutpHI

# minus whatever remainder there was in the

# decrement below OutpHi. Repeats.

SETVAL {tag2=%ROTATEMINUS @tag1} #  decrements tag2  by  value of tag1

# until OutpLO reached

# then resets counter to OutpHI

# minus whatever remainder there was in the

# decrement below OutpLO. Repeats.

SETVAL "tag2=%ROTATEMINUS $var"       #  decrements tag2  by  value of script

# variable named var

# until OutpLO reached

# then resets counter to OutpHI

# minus whatever remainder there was in the

# decrement below OutpLO. Repeats.

# Tcl

SETVAL "tag2=%ROTATEMINUS $x" 

 

 

Rem VB Script

Dim x

SETVAL "tag2=%ROTATEMINUS " & Cstr(x) 

 

// JScript

var x, tagnvalue

tagnvalue = "tag2=%ROTATEMINUS ";

tagnvalue += x;

SETVAL(tagnvalue);

Illegal SETVAL expressions:

 

SETVAL tag2=@tag1+@rotatefan101    # this won't work. 

# What will work is:

SETVAL tag2=[expr [GETVAL tag1]+[GETVAL rotatefan101] ]

 

SETVAL tag2=@tag1+@tag2           # this won't work. 

#What will work are:

SETVAL tag2=[expr [GETVAL tag1]+[GETVAL tag2] ]

# or

SETVAL {tag2=%PLUS @tag1}

#or

SETVAL "tag2=%PLUS @tag1"

 

# this won't work 

set dx [expr [GETVAL r]*[GETVAL da]/180.0*3.1415926]

SETVAL {x=%LOOPPLUS $dx}

#What will work are:

set dx [expr [GETVAL r]*[GETVAL da]/180.0*3.1415926]

SETVAL "x=%LOOPPLUS $dx"

# double quotes needed to force evaluation of dx