Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable Scoping
Message
From
02/02/2001 17:28:24
Dave Nantais
Light speed database solutions
Ontario, Canada
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00471952
Message ID:
00472030
Views:
34
>Is there any way of checking the scope of a variable? What is the scope of the memory variables created by SCATTER MEMVAR?
>
>Thanks.

A variable has the scope you assign it.

for example

LOCAL Test

SCATTER FIELDS Test MEMVAR

The variable m.test is scoped to the procedure and does not affect values outside the procedure.

Be careful....

'm.Test' will be a local memory variable.
'Test' will be the current value of the Test field in the table.
'Test' will be visible to all levels of code.

Should you change the location of the record pointer the variable 'Test' will have a different value.
'Test' will have different values in different forms if each form has its own datasession. But, that is another story.

I recommend preceeding all memory variables with 'm.' for clarity.

HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform