ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] dimen 100.0pt not 100.0pt?
@ 2024-06-10 13:46 Hans van der Meer via ntg-context
  2024-06-10 13:58 ` [NTG-context] " Wolfgang Schuster
  2024-06-10 14:38 ` Hans Hagen via ntg-context
  0 siblings, 2 replies; 3+ messages in thread
From: Hans van der Meer via ntg-context @ 2024-06-10 13:46 UTC (permalink / raw)
  To: NTG ConTeXt; +Cc: Hans van der Meer


[-- Attachment #1.1: Type: text/plain, Size: 476 bytes --]

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




[-- Attachment #1.2.1: Type: text/html, Size: 1513 bytes --]

[-- Attachment #1.2.2: Screenshot 2024-06-10 at 15.37.32.png --]
[-- Type: image/png, Size: 41959 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [NTG-context] Re: dimen 100.0pt not 100.0pt?
  2024-06-10 13:46 [NTG-context] dimen 100.0pt not 100.0pt? Hans van der Meer via ntg-context
@ 2024-06-10 13:58 ` Wolfgang Schuster
  2024-06-10 14:38 ` Hans Hagen via ntg-context
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2024-06-10 13:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Hans van der Meer via ntg-context

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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [NTG-context] Re: dimen 100.0pt not 100.0pt?
  2024-06-10 13:46 [NTG-context] dimen 100.0pt not 100.0pt? Hans van der Meer via ntg-context
  2024-06-10 13:58 ` [NTG-context] " Wolfgang Schuster
@ 2024-06-10 14:38 ` Hans Hagen via ntg-context
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen via ntg-context @ 2024-06-10 14:38 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

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
-----------------------------------------------------------------

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-10 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-10 13:46 [NTG-context] dimen 100.0pt not 100.0pt? Hans van der Meer via ntg-context
2024-06-10 13:58 ` [NTG-context] " Wolfgang Schuster
2024-06-10 14:38 ` Hans Hagen via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).