>Here is the interesting part (at least to me). After this is executed, the variables j and i will not exist, because the will have lost scope. IOW, VFP treats this the same as running a program file. So, if you want a variable to still exist after doing something like this, you have to give it a value before you execute the multi-line selection.
>
>I'll sometimes do SCAN/ENDSCAN loops in the command window when I just want to do a one shot deal.
>
>Anyway, my apologies for wasting your (and my *grin*) time if you already knew this...
What VFP is doing, that it creates a temporary PRG file with the selected code, compiles it and executes. That's why the variables declared in the selected code are not available after the execution (unless they were declared before from the command window, or were declared PUBLIC).
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison