A Program to Display Memory

In last month's Power of Clipper seminar given by Steve Straley,
he mentioned an elegant way of saving arrays to a memory file
and then restoring back to the array. The technique used a
MEMOREAD() on the memory file. This results in giving the name
of the first memory variable in the file, which incidentally
are in ascending alphabetical order from the top of the file.

I thought this might be a way of getting a hold of the names of
the resident memory variables in a Clipper program. I find the
Clipper Debugger to be downright clumsy in this regard. I wrote
a program that worked, but even programs that ran on machines of
the 1950's ran faster. So against my will, I began examining a
series of memory files with DOS's debug. 

Here is what I found:

Variable specific information is contained in the first 18 bytes
of the variable packet. The value of the variable is contained
from positon 33 on.

The variable name is in the first 10 position with a CHR(0) as
it's terminator.

The variable type is in position 12 of the packet.
C3h or CHR(195) is character or memo, CCh or CHR(204) is logical,
CEh or CHR(206) is numeric, C4h or CHR(196) is date.

For character and logical variables, position 17 and 18 contain
the value for the range of the data. For numeric and date vari-
ables, the range is 8. The range, then, points to the end of the
variable packet.

This resulted in a program that allowed for parsing of the memory
variable file with standard higher level Clipper commands that
worked quite well, but took away from the free memory available
that is not needed when using the lower level commands that are
used in this version. 

Essor Maso
Blue Sky Software
18657 Collins St. #19
Tarzana, CA 91356
818-881-1984
