Meer, Hans van der
17. Januar 2016 um 19:03
Thanks Wolfgang. I am afraid, however, your answer inspires me to a subsequent question.

In order to customize  the reference myself my idea is something along the line of:
  \def\myatpage[#1]{ \scratchcounter=\at[#1]\relax\ifnum=\pagenumber etcetera. 
But this gives an error, as dus \expanded{\at[#1]}, as does \expandafter\scratchcounter=
The error is Missing number, treated as zero..

Do you have a hint how to proceed?
\definepagestate[hans]

\starttext

One\setpagestate[hans][one]

\page[+2]

Two\setpagestate[hans][two]

Three\setpagestate[hans][three]

\blank

\ifnum0\pagestaterealpage{hans}{two}=0\pagestaterealpage{hans}{one}
    The references are on the same page.
\else
    The references are on different pages.   
\fi

\blank

\ifnum0\pagestaterealpage{hans}{two}=0\pagestaterealpage{hans}{three}
    The references are on the same page.
\else
    The references are on different pages.   
\fi

\stoptext

Wolfgang