G'day muthm,
Take a look at ++hv's post from last week which discusses this issue. In particular, his "it acts something like a state variable" aligns with your "keeps its value from the previous call".
The solution he presents is the same as the response you've already received from ++LanX; namely, separate the declaration from the conditional assignment.
— Ken
In reply to Re: Conditional initialization of my-variables
by kcott
in thread Conditional initialization of my-variables
by muthm
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |