ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Fwd: expansion and variables
Date: Wed, 17 Jul 2024 23:10:47 +0200	[thread overview]
Message-ID: <9b39d67e-f4bd-4261-a2ea-3f0a7d4305be@xs4all.nl> (raw)
In-Reply-To: <fccac199-96e2-4bc8-bf04-5d6b0012afbe@xs4all.nl>




-------- Forwarded Message --------
Subject: Re: [NTG-context] expansion and variables
Date: Wed, 17 Jul 2024 23:10:23 +0200
From: Hans Hagen <j.hagen@xs4all.nl>
To: Henning Hraban Ramm <texml@fiee.net>

On 7/17/2024 10:40 PM, Henning Hraban Ramm wrote:
> 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

\setevariable

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

-- 

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

       reply	other threads:[~2024-07-17 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fccac199-96e2-4bc8-bf04-5d6b0012afbe@xs4all.nl>
2024-07-17 21:10 ` Hans Hagen [this message]
2024-07-18  6:33   ` [NTG-context] " Henning Hraban Ramm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b39d67e-f4bd-4261-a2ea-3f0a7d4305be@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).