I want the ability to reset the values of adr_keys
to blank values. What type of function should I construct?
I will be using
\tl_if_blank:VF \l_dwlg_tl
{ \tl_use:N \l_dwlg_tl \\ }
to print the values by checking whether values are blank.
The problem with using initial
is that this would only apply on the first instance. And using default
would require me to supply the name and keeping it empty.
The command \adrPrint
would print the key values. For the second
call to \adrPrint
I want to use the values used in the previous
\adrPrint
. But I need to reset all values for the third call to
\adrPrint
\documentclass[a4paper,12pt]{article}
\ExplSyntaxOn
\keys_define:nn { adr_keys }
{
name .tl_set:N = \l_name_tl,
role .tl_set:N = \l_role_tl,
kmpn .tl_set:N = \l_kmpn_tl,
dwlg .tl_set:N = \l_dwlg_tl,
hmlt .tl_set:N = \l_hmlt_tl,
vltw .tl_set:N = \l_vltw_tl,
cbrg .tl_set:N = \l_cbrg_tl,
knty .tl_set:N = \l_knty_tl,
pstc .tl_set:N = \l_pstc_tl,
ktry .tl_set:N = \l_ktry_tl,
}
\ExplSyntaxOn
\begin{document}
\adrPrint
{
name={Heime Borgia},
dwlg={405 Hilgard Ave},
cbrg={Los Angeles},
knty={California},
pstc={90095},
ktry={United States},
}
\adrPrint
{
name={Likku Cirillu},
dwlg={409 Hilgard Ave},
}
\adrReset
\adrPrint
{
name={Heime Borgia},
dwlg={Gower Street},
cbrg={London},
pstc={WC1E 6BT},
}
\end{document}
\ExplSyntaxOn
.\l_name_tl
(which is obviously highly likely to conflict with all kinds of stuff) but\l_adr_keys_name_tl
etc. The same is true of any functions you define.