The I do not understand. I am testing if a dimension set can be checked against the expected value. It looks like 100.0pt is not really 100.0pt. Why? And how can I do this test properly with true as result?
\scratchdimen=100pt\relax \iftok{\the\scratchdimen}{100.0pt}true\else false\fi 
printing \the\scratchdimen results in 100.0pt
while \meaning\scratchdimen results in: constant dimension 100.0pt
yours sincerely dr. Hans van der Meer
Hans van der Meer via ntg-context schrieb am 10.06.2024 um 15:46:
The I do not understand. I am testing if a dimension set can be checked against the expected value. It looks like 100.0pt is not really 100.0pt. Why? And how can I do this test properly with true as result?
\scratchdimen=100pt\relax \iftok{\the\scratchdimen}{100.0pt}true\else false\fi Screenshot 2024-06-10 at 15.37.32.png
printing \the\scratchdimen results in 100.0pt
while \meaning\scratchdimen results in: constant dimension 100.0pt
\starttext
\scratchdimen=100.0pt
\ifdim\scratchdimen=100.0pt True \else False \fi
\stoptext
Wolfgang
On 6/10/2024 3:46 PM, Hans van der Meer via ntg-context wrote:
The I do not understand. I am testing if a dimension set can be checked against the expected value. It looks like 100.0pt is not really 100.0pt. Why? And how can I do this test properly with true as result?
\scratchdimen=100pt\relax \iftok{\the\scratchdimen}{100.0pt}true\else false\fi Screenshot 2024-06-10 at 15.37.32.png
printing \the\scratchdimen results in 100.0pt
while \meaning\scratchdimen results in: constant dimension 100.0pt
It has to do with catcodes (of p and t) so you need this:
\iftok{\the\scratchdimen}{\detokenize{100.0pt}}true\else false\fi
But ... you should do it the way Wolfgang pointer out
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------