Something’s wrong with my code.
I’ll try to keep a status to output a certain marker only the first time after a change. With the code below I get it never.

I guess it’s an expansion problem again, but I didn’t find the right places for \expanded – if I use it in front of every \getvariable, I get the output every time.

Please help…
Hraban



\setvariable{Thing}{Status}{1}
\setvariable{Thing}{PreviousStatus}{0}

\define[1]\startThing{
  \setvariable{Thing}{PreviousStatus}{\getvariable{Thing}{Status}}
  \setvariable{Thing}{Status}{#1}
  <<< %

\doifnot{\getvariable{Thing}{Status}}{\getvariable{Thing}{PreviousStatus}}{%
    \bold{\getvariable{Thing}{Status}}%
  }%
}

\def\stopThing{>>>\par}

\starttext

\startThing{A} a \stopThing
\startThing{B} b \stopThing
\startThing{A} c \stopThing
\startThing{C} d \stopThing
\startThing{C} e \stopThing
\startThing{A} f \stopThing
\startThing{A} g \stopThing
\startThing{A} h \stopThing

\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to