ernobe wrote:
> The following expression:
>
> "help" ? { move( 2 )
> &pos }
>
> produces 1. Shouldn't the value of &pos be 3?
To see whether I get the same result, I wrote the following
write(image("help" ? { move( 2 )
&pos }))
and it printed out 1, as you say.
By the time you get to the write, though, you have left the string
scanning
environment, so &pos has reverted to its pre-scanning value of 1.
Trying the following, it writes out the 3 that you expect [re****ting the
value before leaving the string scanning expression]
"help" ? { write(image({move( 2 )
&pos }))}
And if you try this it prints 6 [ &pos has reverted to its previous value,
set in the outer string scanning expression]
"assist" ? { move(5)
write(image("help" ? { move( 2 )
&pos }))
}
--
CaroleT


|