Hi,
As far as I understand, I can store the result of a filter/function in a field, but not the result of a procedure:
\procedure compute(n)
{{{[<n>multiply[3]]}}}
\end
\function .f(n)
[<n>multiply[3]]
\end
!!! Procedure
regular call: <<compute 4>>
<$let myres=<<compute 4>>>
<$button>
<$action-setfield result1=<<myres>>/>
store result
</$button>
</$let>
Value result: {{!!result1}} (doesn't work)
!!! Function
regular use: {{{[.f[4]]}}}
<$let myres={{{[.f[4]]}}}>
<$button>
<$action-setfield result2=<<myres>>/>
store result
</$button>
</$let>
Value result: {{!!result2}} (works)
But if my calculation is complex, for example below, and cannot be done in a filter/function, is there a way to store the result into a field?
\procedure complexproc(n switch)
<$list filter="[<switch>compare:string:eq[a]]">
{{{[<n>multiply[3]]}}}
</$list>
<$list filter="[<switch>compare:string:eq[b]]">
{{{[<n>add[55]]}}}
</$list>
<$list filter="[<switch>compare:string:eq[c]]">
{{{[<n>]}}}
</$list>
\end
Thanks!