ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Testing value of a \def
@ 2018-02-08  9:50 Procházka Lukáš Ing.
  2018-02-08 10:06 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Procházka Lukáš Ing. @ 2018-02-08  9:50 UTC (permalink / raw)
  To: ConTeXt

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

Hello,

I'm trying to test whether value of \jobname is "Test"; I suppose it should be as the file name is "Test.mkiv".

But the code:

----
\starttext
   \jobname
   \doifelse{\jobname}{Test}{Yes}{No}
   \def\T{Test}
   \ifx\jobname\T True\else False\fi
   \ctxcommand{doifelse("\jobname" == "Test")}{1}{0}
\stoptext
----

yields "No", "False" and "1", so only the printed "1" is what I expect.

Why \doifelse and \ifx are evaluated as false?

Best regards,

Lukas


-- 
Ing. Lukáš Procházka | mailto:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

[-- Attachment #2: Test.mkiv --]
[-- Type: application/octet-stream, Size: 179 bytes --]

\starttext
  \jobname
  \doifelse{\jobname}{Test}{Yes}{No}
  \def\T{Test}
  \ifx\jobname\T True\else False\fi
  \ctxcommand{doifelse("\jobname" == "Test")}{1}{0}
\stoptext

[-- Attachment #3: Test.pdf --]
[-- Type: application/pdf, Size: 5494 bytes --]

[-- Attachment #4: Type: text/plain, Size: 492 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2018-02-08 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08  9:50 Testing value of a \def Procházka Lukáš Ing.
2018-02-08 10:06 ` Wolfgang Schuster
2018-02-08 12:23   ` Procházka Lukáš Ing.

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