![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Sun, 19 Nov 2006, Taco Hoekwater wrote:
Aditya Mahajan wrote:
Hi,
Can someone explain what should be the correct order of expansion here. I want to enter the date entered as a variable to a file.
\setvariables [test] [date={d=11,m=11,y=2006}]
\starttext
The date entered was \expanded{\date[\getvariable{test}{date}]}.
\immediate\openout \scratchwrite test-001 \immediate\write \scratchwrite {The date entered was} % None of these work.
The best you can get is:
\immediate\write\scratchwrite{\noexpand\date[\getvariable{test}{date}]}
(The variable is expanded, but \date is not)
Thanks for the hint. Fortunately, I just needed the date in the format [year,/,mm,/,dd], so I can do something like \expanded{\setvariables[test:date][\getvariable{test}{date}]} \immediate\openout \scratchwrite test-001 \immediate\write \scratchwrite {The date entered was} \immediate\write \scratchwrite {\getvariable{test:date}{y}/\getvariable{test:date}{m}/\getvariable{test:date}{d}} \closeout\scratchwrite Aditya