I have this MWE that tries to return a value from \l_example_foo_int from a function:
\documentclass[a4paper]{article}
\usepackage{expl3}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\returnvalue}{}{
\int_new:N \l_example_foo_int
\int_add:Nn \l_example_foo_int {10}
% return value
\l_example_foo_int
}
\begin{document}
Should print value here:
\returnvalue
\int_new:N \l_example_bar_int
\int_add:Nn \l_example_bar_int \returnvalue
Should print value here:
\l_example_bar_int
\end{document}
It throws an error however.
Wondering how to get it so it can return a value from a function and that value can be typeset or \typeout or the like.
\int_newoutside of the function I still get an error! Missing number, treated as zero.. – Lance Mar 26 '18 at 17:48\returnvalueis unexpandable and can't be fed to\int_add:Nnagain – Mar 26 '18 at 18:04