Update variable while running if statement

surepic:
@PaulS why pinmode on analog pins is not good idea?

An answer to Reply #10 is far more important.

...R

PS.. apologies to all. I thought @surepic was the OP.