Discussion Locked

scatter memvar inconsistent in VFP

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
It seems that using SCATTER MEMVAR works well in VFP within programs. However, when I select a section of code to run SCATTER MEMVAR seems inconsistent. Is this a known issue? and what can be done about it?

5 replies

by stillatit

Two issues --

SCATTER MEMVAR works with scoped variables. If you have some public and some private variables with names the same as field names, and you are suspended in a routine, when you resume and the variables go out of scope, they go away.
SCATTER MEMVAR works with whatever work area is current at the moment. Be sure you know which area is current, and which record is current.

Good luck.

by zlatin zlatev

If you are marking a section of VFP code to run on the VFP command window it is interpreted as a temporary program, and all variables created in it are Local by default.
So you should declare a public variable and use
Scatter Name
instead of scatter memvar

by symesd

All code is typed in the PRG file being worked on at the time.
All code executed is selected by the mouse and right-clicked "Execute Selection".
All var's are declared "Public".
(any other thoughts?)

This discussion is closed to new replies.