>VFP supports block scoop, the block is the whole function.This is not what I would call block scope. It is function scope.
>I would not disagree having block scoop to IF - Case - For - Etc... Statements, but this would really break a lot of existing code.Not if you introduce a new syntax, like braces or an VB-like "Option scope" at the top of the code block.
Ex.:
Without code block:
FOR I = 1 TO 10
LOCAL N
N = I
ENDFOR
W = 10 ^ N
With code block:
FOR I = 1 TO 10
{
LOCAL N
N = I
}
ENDFOR
W = 10 ^ N
>I don't agrree a new Sys() function would make it harder the code to read, i would put the SYS() call in the INIT of my MTDLL's base class and then forget about it.What if I want to write a new class that will be used by different applications having different scope definition? I would have to go through the gymnastic of saving the current setting, change it to what I need and restore it back. This will clutter my code.
This may also break existing code in your global classes that your application call.