sets scratchpad values:
n
to
n-1
setvar(&n,&i);