I also think that it is better to hide this in a function call, but I think you would need to define a static variable to hold the value that MyVar will return each time, something like...
<code>...