[snip]
>Too bad you got bitten.
Thanks for your empathy. :)
>I think one useful command would be SET MDOT ON|OFF, where:
>
>- ON is the current behaviour, and would continue to be the default
>- OFF would prevent VFP from looking at field names in open tables for commands as listed in the Wiki and elsewhere.
>
>With the double improvements of fewer bugs and a (slight) performance improvement in some cases I think a lot of developers would set it OFF in their apps.
The command SET MDOT OFF would cause errors in my legacy code if used in the init of the app, for sure. In my older and newer code there are enough places where SCATTER MEMVAR is done with references to the field names in the proceeding code. At least those places would give erroneous situations with a SET MDOT OFF in the init of the app.
However, SET MDOT OFF LOCAL or SET MDOT OFF PRIVATE would be useful indeed. Perhaps LOCAL should be the default behavior.
A disadvantage of SET MDOT is that it suggests that the m. will be ignored anyway.
>I like your idea of SET {keyword} TO {value} LOCAL.
>To me, it looks like your USE and HIDE proposals are just to get around this mdot issue, which would be already handled by SET MDOT. Can other uses not already be emulated with judicious use of datasessions?
I have thought of datasessions too, but I think their overhead is too much and that my proposals allow better finetuning and control.
>I don't understand your LPARAMETERS( TABLE LocalAlias, VARIABLE LocalVar ) proposal.
A local variable can be passed on to a function as a parameter. This is the appropriate way to use its value in the routine anyway. If we get the possibility of creating local tables, then there should also be a way to let a function use that table anyway. The proposed syntax extension for the LPARAMETERS command will allow such usage. But it's only a proposal. The foxteam can do better, I'm sure. Here's an example:
USE MyTable LOCAL
scan
do Something
do SomethingElse with TABLE 'MyTable'
endscan
RETURN
PROCEDURE Something
wait wind iif( empty( alias() ), "Empty workarea", "Alias: " + alias() ) timeout 1
RETURN
PROCEDURE SomethingElse( TABLE tcAlias )
local oldSele
oldSele = select()
select ( tcAlias )
wait wind transform( eval( field( 1, tcAlias ) ) ) timeout 1
select ( oldSele )
RETURN
Groet,
Peter de Valença
Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.