Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Icon > Re: Value of &p...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 152 of 189
Post > Topic >>

Re: Value of &pos

by "carolet" <carolet_cetera@[EMAIL PROTECTED] > May 11, 2007 at 05:31 PM

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
 




 3 Posts in Topic:
Value of &pos
ernobe <ernobe@[EMAIL   2007-05-10 17:18:12 
Re: Value of &pos
"carolet" <c  2007-05-11 17:31:19 
Re: Value of &pos
ernobe <ernobe@[EMAIL   2007-05-13 14:30:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 17:19:19 CDT 2008.