Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Local scoop wish
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00720623
Message ID:
00720970
Views:
11
VFP supports block scoop, the block is the whole function. I would not disagree having block scoop to IF - Case - For - Etc... Statements, but this would really break a lot of existing code.

I always code my functions declaring all variables as LOCAL but sometimes a typo or a careless programmer can make a whole component crash simply because of only one object assigned to an undeclared variable.

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.

But again, a better solution would be an 'Option Explicit' option so we can get compile time error for all undeclared variables.

>C, C++, C#, VB.NET and others support block scope of variables. In fact, I think that the list of languages that do not support block scope is shorter than the inverse.
>
>I do not agree with a new SYS () function to introduce this new feature. It would just make the code harder to read since you don't necessary see the SYS () call in the code you read and have to remember or assume that it is in effect. We already have to much environment settings to remember, so don't make it worse. Using braces ({}) to delimiter a block code would be a better solution IMHO.
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform