Ok, can anyone explain to me why this 3 line code wont work?

start of frame > set global value A to 1
if global value A = 1 And Object leaves the area then
Wrap object around screen

but no, it wont work that just makes the object NOT wrap BUT if you change the to events around so its

start of frame > set global value A to 1
if Object leaves the area And global value A = 1 then
Wrap object around screen

doing it that way makes the object wrap despite what the global value is? it just ignors it??

Any one help
Thanks
Gib